Feature #3903
closedEqualityComparable and FormattedOutputFunction for StatusDataset and other mgmt/nfd classes
100%
Description
For TLV structs of NFD management protocol, including ChannelStatus
FaceStatus
FibEntry
ForwarderStatus
RibEntry
StrategyChoice
, implement EqualityComparable concept and FormattedOutputFunction:
bool operator==(const T& a, const T& b);
bool operator!=(const T& a, const T& b);
std::ostream& operator<<(std::ostream& os, const T&);
Then use these functions in NFD's RibManager
FibManager
StrategyChoiceManager
test suites instead of NFD's own implementation.
Updated by Junxiao Shi almost 8 years ago
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
Updated by Junxiao Shi almost 8 years ago
- % Done changed from 0 to 20
https://gerrit.named-data.net/3562 adds the operators for ndn::nfd::StrategyChoice
.
Updated by Junxiao Shi almost 8 years ago
- Assignee changed from Junxiao Shi to Davide Pesavento
I won't do anymore because nfdc
test turns out doesn't need this. Davide is actively working on this so reassigning.
Updated by Davide Pesavento almost 8 years ago
Junxiao Shi wrote:
I won't do anymore because
nfdc
test turns out doesn't need this. Davide is actively working on this so reassigning.
I have a use case for formatted output (mainly logging and debugging in some management stuff I'm working on), but I don't think I need operator==
and operator!=
. What was the reason for them? Should we still add them to the library without a use case?
Updated by Junxiao Shi almost 8 years ago
==
and !=
are useful to simplify some test cases.
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 20 to 30
ChannelStatus
https://gerrit.named-data.net/3667
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 30 to 40
FaceStatus
https://gerrit.named-data.net/3671
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 40 to 50
https://gerrit.named-data.net/3678 has the implementation for ForwarderStatus
, plus some minor adjustments to previous commits.
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 50 to 60
FibEntry
(and NextHopRecord
) https://gerrit.named-data.net/3691
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 60 to 70
RibEntry
(and Route
) https://gerrit.named-data.net/3700
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 70 to 80
In https://gerrit.named-data.net/3703 I've implemented similar functionality for FaceEventNotification
, although it's not strictly a Status Dataset item.
Updated by Junxiao Shi almost 8 years ago
https://gerrit.named-data.net/3729 is merged and breaks NFD:
../tools/nfdc/rib-module.cpp: In static member function ‘static void nfd::tools::nfdc::RibModule::add(nfd::tools::nfdc::ExecuteContext&)’:
../tools/nfdc/rib-module.cpp:89:72: error: enumeral and non-enumeral type in conditional expression [-Werror]
.setFlags((wantChildInherit ? ndn::nfd::ROUTE_FLAG_CHILD_INHERIT : 0) |
^
../tools/nfdc/rib-module.cpp:90:61: error: enumeral and non-enumeral type in conditional expression [-Werror]
(wantCapture ? ndn::nfd::ROUTE_FLAG_CAPTURE : 0));
Updated by Davide Pesavento almost 8 years ago
Weird, there's really no reason to throw an error on that code (it's actually a warning turned into an error by -Werror
). The conversion rules for the conditional operator are very precise and clear, and the case of note-12 is perfectly fine, well-defined behavior.
In any case, we have to workaround the silly warning. Feel free to submit a patch as I won't have time in the next couple of days. Changing 0
into ndn::nfd::ROUTE_FLAGS_NONE
should be sufficient.
Updated by Junxiao Shi almost 8 years ago
https://gerrit.named-data.net/3762 makes use of RibEntry
and FibEntry
operator!=
in NFD test cases.
Updated by Davide Pesavento almost 8 years ago
Junxiao Shi wrote:
https://gerrit.named-data.net/3762 makes use of
RibEntry
andFibEntry
operator!=
in NFD test cases.
Why are you doing this? This bug is assigned to me, so you should at least coordinate with me before making any changes related to it. Moreover, I already submitted a WIP change with the same purpose (3708).
Updated by Junxiao Shi almost 8 years ago
Reply to note-15:
I'm working on a change in rib-manager so I need this mess gone before I can continue.
Updated by Davide Pesavento almost 8 years ago
- % Done changed from 80 to 90
Updated by Davide Pesavento over 7 years ago
- Subject changed from EqualityComparable and FormattedOutputFunction for StatusDataset structs to EqualityComparable and FormattedOutputFunction for StatusDataset and other mgmt/nfd classes
Updated by Junxiao Shi over 7 years ago
What's missing in this issue, or is it completed?
Updated by Davide Pesavento over 7 years ago
FaceQueryFilter
is missing I think. Plus some simplifications can now be done in NFD's FaceManager
tests.
Updated by Davide Pesavento over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
Actually, I'm not going to work on FaceQueryFilter
. It's not listed in the ticket description, and I don't need it. In any case, the operators can be added later, when (if) needed.