[Ns-developers] NS3 Time objects
Tom Henderson
tomh at tomh.org
Mon Nov 6 17:15:20 PST 2006
Mathieu Lacage wrote:
>
> I pushed the final version with doxygen tagging, documentation and
> regression tests in http://code.nsnam.org/mathieu/ns-3
>
> I would like to go forward with this set of features so, baring further
> comments, I would like to push this implementation in the main repo next
> week. I think we can get the 128bit integer version in later: it should
> have zero impact on user code.
>
Mathieu, although I am not sure that some of these use cases will crop
up in practice (regarding timesquared and other higher-ordered
operations), they do not seem to complicate the user API for the basic
user, so I agree with your proposal and for pushing it in.
I think it is very similar to George's proposal from 10/30 except for:
- mixing data types in operators is avoided, which I think seems to be
the safer option to avoid commutativity and associativity problems
- you supported a use case (multiplication and division of time objects)
in which George was not interested; I don't care strongly either way
- as for string conversions, I don't have a strong opinion of whether
these should be member functions or not; I would probably lean towards
non-member functions for encapsulation reasons
One thing that I think you should not do is punish the user so severely
for trying to convert Time to a double ("ApproximateToSeconds"). I
would suggest "GetSeconds" and just document the function with a doxygen
comment that object to float type conversions may be subject to certain
portability issues.
Thanks for doing all of the doxygen up front too,
Tom
More information about the Ns-developers
mailing list