[Ns-developers] finalizing the ns-3 object model

Tom Henderson tomh at tomh.org
Tue Jan 15 07:57:57 PST 2008


Mathieu Lacage wrote:
> On Mon, 2008-01-14 at 23:16 -0800, Tom Henderson wrote:
> 
>>> void BuildAdhoc (Ptr<WifiChannel> channel, Ptr<Node> node, std::string
>>> rateType, Parameters parameters)
>>> {
>>>   Ptr<WifiNetDevice> device = ...;
>>>   ObjectFactory factory = ObjectFactory (rateType);
>>>   Ptr<WifiRateControl> rate = factory->Create
>>> (parameters)->QueryInterface<WifiRateControl> ();
>>>   device->SetRate (rate);
>>> }
>>>
>>> It should be trivial to hook the "rate type" string from a command-line
>>> parser and to convey that directly to this BuildAdhoc function. Yes, if
>>> you do all of this, you are going to lose _some_ of the automaticity of
>>> the current way of doing things but the result is just vastly easier to
>>> comprehend I think.
>> Can you explain the distinction in this example between passing rateType 
>> and parameters separately, rather than just making rateType one of the 
>> parameters?
> 
> I am not sure I understand your question so, I will instead attempt to
> describe this BuildAdhoc function in more details.

the question was whether the string could be another parameter or was 
outside of the parameter object.


More information about the Ns-developers mailing list