Actions
Task #4104
closedReplace FibEntry with a tuple
Start date:
05/31/2017
Due date:
% Done:
0%
Estimated time:
Description
Currently the FibEntry is a class collecting pretty plain information. It is flawed in the following ways:
- It contains a copy of the Name, which also serves as the key to the map the Fib itself contains, wasting memory.
- It needlessly encapsulates the data in a way that confuses someone unfamiliar with the code.
- The entry is really just plain-old-data, and doesn't need any methods or functions associated with it, so the class abstraction carries too much logical overhead.
- The sequence number appears to be used only for debugging purposes. Not documenting it might lead a casual reader to assume that it has some other use.
Since the FIB conceptually is just a map that takes valid NDN name prefixes to a list of next-hops sorted by ascending cost, there is no need to complicate the abstraction with classes at no benefit.
Instead, the FibEntry class could be replaced with a std::tuple that contains the list of nexthops, the refresh event id, and the sequence number as elements. This preserves the mapping relationship, but also removes the need for an entire class that provides an unwieldy interface.
Updated by Nicholas Gordon almost 7 years ago
- Target version changed from v0.4.0 to v0.5.0
Updated by Nicholas Gordon almost 7 years ago
- Target version changed from v0.5.0 to Minor release 0.4.1
Updated by Ashlesh Gawande over 6 years ago
- Target version changed from Minor release 0.4.1 to v0.5.0
Updated by Nicholas Gordon over 6 years ago
- Status changed from New to Abandoned
Actions