A search almost always requires your consent. Be assertive when you deny permission to search. When you get out of your car make sure you roll up your windows and lock your door behind you (don't lock yourself out).
If the officer still searches anyway he/she will have to justify the reason. The more assertive you are denying permission (and I don't mean being rude, just being clear and firm) and the more proactive you are by keeping windows up and doors secured, the harder it will be for the officer to search.
If you are searched anyway and feel it was unjustified then you can always talk to an attorney to determine if your rights were violated.
Anyway.... smelling marijuana is enough reason to have a look inside the car, but if the officer starts opening containers and digging through purses then he/she is likely going to have a hard time justifying the warrantless search. if they can smell marijuana but it is not in plain view, and if they are determined to search the car in detail to find it, then they are SUPPOSED to obtain a search warrant to do so.
It is quite easy to get a person to consent to a search without realizing they have done so, which may have been the case here. If they obtain your consent, or even implied consent, then the warrant is not an issue.
If you received any citation out of this then you can probably defeat it. The officer claiming to smell marijuana in the car as it drove past sounds pretty bogus. If the officer had seen you weaving along the road then a sobriety test would have most certainly been conducted... and you didn't mention that.
Sounds like this officer was just fishing. You were thrown back.