fw: reorder function params to make the strategy API more uniform
Also add a non-const overload of Face::getCounters to avoid const_cast
Refs: #5173
Change-Id: Iff0bfbdedb90e68a373090cf3f247d9a7501f58d
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index 4b5345e..099d031 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -62,10 +62,10 @@
}
void
- afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+ afterReceiveInterest(const Interest& interest, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry) override
{
- DummyStrategy::afterReceiveInterest(ingress, interest, pitEntry);
+ DummyStrategy::afterReceiveInterest(interest, ingress, pitEntry);
if (afterReceiveInterest_count <= 1) {
setExpiryTimer(pitEntry, 190_ms);
@@ -73,10 +73,21 @@
}
void
- beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override
+ afterContentStoreHit(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override
{
- DummyStrategy::beforeSatisfyInterest(pitEntry, ingress, data);
+ if (afterContentStoreHit_count == 0) {
+ setExpiryTimer(pitEntry, 190_ms);
+ }
+
+ DummyStrategy::afterContentStoreHit(data, ingress, pitEntry);
+ }
+
+ void
+ beforeSatisfyInterest(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override
+ {
+ DummyStrategy::beforeSatisfyInterest(data, ingress, pitEntry);
if (beforeSatisfyInterest_count <= 2) {
setExpiryTimer(pitEntry, 190_ms);
@@ -84,19 +95,8 @@
}
void
- afterContentStoreHit(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override
- {
- if (afterContentStoreHit_count == 0) {
- setExpiryTimer(pitEntry, 190_ms);
- }
-
- DummyStrategy::afterContentStoreHit(pitEntry, ingress, data);
- }
-
- void
- afterReceiveData(const shared_ptr<pit::Entry>& pitEntry,
- const FaceEndpoint& ingress, const Data& data) override
+ afterReceiveData(const Data& data, const FaceEndpoint& ingress,
+ const shared_ptr<pit::Entry>& pitEntry) override
{
++afterReceiveData_count;
@@ -104,14 +104,14 @@
setExpiryTimer(pitEntry, 290_ms);
}
- this->sendDataToAll(pitEntry, ingress.face, data);
+ this->sendDataToAll(data, pitEntry, ingress.face);
}
void
- afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+ afterReceiveNack(const lp::Nack& nack, const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry) override
{
- DummyStrategy::afterReceiveNack(ingress, nack, pitEntry);
+ DummyStrategy::afterReceiveNack(nack, ingress, pitEntry);
if (afterReceiveNack_count <= 1) {
setExpiryTimer(pitEntry, 50_ms);