« Return to Thread: Consistency in interfaces between RateErrorModel and DropTailQueue (and possibly others)

Re: Consistency in interfaces between RateErrorModel and DropTailQueue (and possibly others)

by Tom Henderson-2 :: Rate this Message:

| View in Thread

On 04/18/2012 06:07 AM, mthieu lacage wrote:

>
>
> Envoyé de mon iPad
>
> Le 18 avr. 2012 à 13:25, Vedran Miletić<rivanvx@...>  a écrit :
>
>> Hi guys,
>>
>> while preparing ns-3-based course materials, I noticed that we have
>> ErrorUnit enum in paralel to RateErrorModel, and similar meaning Mode
>> enum inside DropTailQueue, so one uses them like
>>
>> em->SetAttribute ("ErrorUnit", EnumValue (EU_PKT));
>> queue->SetAttribute ("Mode", EnumValue (DropTailQueue::PACKETS));
>>
>> This is a bit inconsistent. I propose to move ErrorUnit enum inside
>> RateErrorModel so one would have to do
>>
>> em->SetAttribute ("ErrorUnit", EnumValue (EU_PKT));
>>
>> I also propose to refactor DropTailQueue/RedQueue Mode enum a bit to be:
>>
>>   enum QueueMode
>>   {
>>     QM_ILLEGAL,     // Mode not set
>>     QM_PKT,     // Use number of packets for maximum queue size
>>     QM_BYTE,       // Use number of bytes for maximum queue size
>>   };
>
> how avout making the short names actually longer and more descriptive instead ?

Vedran, what about moving QueueMode to class Queue?  I'm OK with moving
ErrorUnit within RateErrorModel and to make the names consistent and
more descriptive across enums.

- Tom

 « Return to Thread: Consistency in interfaces between RateErrorModel and DropTailQueue (and possibly others)