Task #2130
closed
Change typeof DEFAULT_INTEREST_LIFETIME
Added by Junxiao Shi about 10 years ago.
Updated almost 10 years ago.
Description
ndn::DEFAULT_INTEREST_LIFETIME
currently has time::seconds
type.
It should be changed to time::milliseconds
to be consistent with the definition of InterestLifetime field.
- Blocks Task #2202: Eliminate DEFAULT_INTEREST_LIFETIME in pit::FaceRecord::update added
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
This is a potentially breaking change (in case someone assign this constant to time::seconds
), but I'm equipped with ndn-cxx-breaks now.
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
I disagree with this issue.
What's a point of this change? The whole idea of using explicit timing in the library is to ensure that everybody knows exactly what time units they are talking about. There is explicitly no indication of time units in the name of DEFAULT_INTEREST_LIFETIME
variable and nobody should have assumed anything about .count()
. If count is used, it must have been used in concert with duration_cast
.
The default value of InterestLifetime should be declared as the same type to be more semantically correct.
There is no semantical difference. Time type is just implementation choice, which doesn't affect anything.
Then documentation (including Doxygen) should represent this as "unspecified duration type".
So far, we have only doxygen docs. I'm ok putting a doxygen comment near the constant.
After changing documentation, is there a reason against declaring as milliseconds?
What's a point of the change? Keeping as is "saves space"
Declaring as a different type requires duration_cast every time it's used.
Hopefully this casting is done at compile time, where no space is saved.
If this casting is done at runtime, that's worse because code execute slower.
Whenever ".count()" method is used on a time variable, it must be combined with duration_cast
, unless there is a guarantee that the variable represents correct unit.
Anyhow. I don't see the value to do changes. If you really realy want to change, ok then.
- Status changed from Resolved to Code review
- Status changed from Code review to Closed
Also available in: Atom
PDF