mgmt: rename 'datas' to 'data' in FaceStatus and ForwarderStatus
Plural form of 'data' is 'data'.
refs #3955
Change-Id: I225a384c9a9ecf784f8cd55df19d391931619984
diff --git a/src/encoding/tlv-nfd.hpp b/src/encoding/tlv-nfd.hpp
index 0033f22..1ae88e5 100644
--- a/src/encoding/tlv-nfd.hpp
+++ b/src/encoding/tlv-nfd.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -72,10 +72,10 @@
// ForwarderStatus and FaceStatus counters
NInInterests = 144,
- NInDatas = 145,
+ NInData = 145,
NInNacks = 151,
NOutInterests = 146,
- NOutDatas = 147,
+ NOutData = 147,
NOutNacks = 152,
NInBytes = 148,
NOutBytes = 149,
@@ -90,9 +90,11 @@
// RIB Management
RibEntry = 128,
Route = 129
-
};
+DEPRECATED() constexpr auto NInDatas = NInData;
+DEPRECATED() constexpr auto NOutDatas = NOutData;
+
enum {
// Local Control Header
LocalControlHeader = 80,
diff --git a/src/mgmt/nfd/face-status.cpp b/src/mgmt/nfd/face-status.cpp
index 53ccf61..3361d99 100644
--- a/src/mgmt/nfd/face-status.cpp
+++ b/src/mgmt/nfd/face-status.cpp
@@ -54,30 +54,18 @@
{
size_t totalLength = 0;
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::Flags, m_flags);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NOutBytes, m_nOutBytes);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NInBytes, m_nInBytes);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NOutNacks, m_nOutNacks);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NOutDatas, m_nOutData);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NOutInterests, m_nOutInterests);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NInNacks, m_nInNacks);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NInDatas, m_nInData);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::NInInterests, m_nInInterests);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::LinkType, m_linkType);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::FacePersistency, m_facePersistency);
- totalLength += prependNonNegativeIntegerBlock(encoder,
- tlv::nfd::FaceScope, m_faceScope);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Flags, m_flags);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutBytes, m_nOutBytes);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInBytes, m_nInBytes);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutNacks, m_nOutNacks);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutData, m_nOutData);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutInterests, m_nOutInterests);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInNacks, m_nInNacks);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInData, m_nInData);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInInterests, m_nInInterests);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::LinkType, m_linkType);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FacePersistency, m_facePersistency);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FaceScope, m_faceScope);
if (m_expirationPeriod) {
totalLength += prependNonNegativeIntegerBlock(encoder,
tlv::nfd::ExpirationPeriod, static_cast<uint64_t>(m_expirationPeriod->count()));
@@ -190,12 +178,12 @@
BOOST_THROW_EXCEPTION(Error("missing required NInInterests field"));
}
- if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInDatas) {
+ if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInData) {
m_nInData = readNonNegativeInteger(*val);
++val;
}
else {
- BOOST_THROW_EXCEPTION(Error("missing required NInDatas field"));
+ BOOST_THROW_EXCEPTION(Error("missing required NInData field"));
}
if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInNacks) {
@@ -214,12 +202,12 @@
BOOST_THROW_EXCEPTION(Error("missing required NOutInterests field"));
}
- if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutDatas) {
+ if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutData) {
m_nOutData = readNonNegativeInteger(*val);
++val;
}
else {
- BOOST_THROW_EXCEPTION(Error("missing required NOutDatas field"));
+ BOOST_THROW_EXCEPTION(Error("missing required NOutData field"));
}
if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutNacks) {
@@ -280,7 +268,7 @@
}
FaceStatus&
-FaceStatus::setNInDatas(uint64_t nInData)
+FaceStatus::setNInData(uint64_t nInData)
{
m_wire.reset();
m_nInData = nInData;
@@ -304,7 +292,7 @@
}
FaceStatus&
-FaceStatus::setNOutDatas(uint64_t nOutData)
+FaceStatus::setNOutData(uint64_t nOutData)
{
m_wire.reset();
m_nOutData = nOutData;
@@ -348,10 +336,10 @@
a.hasExpirationPeriod() == b.hasExpirationPeriod() &&
(!a.hasExpirationPeriod() || a.getExpirationPeriod() == b.getExpirationPeriod()) &&
a.getNInInterests() == b.getNInInterests() &&
- a.getNInDatas() == b.getNInDatas() &&
+ a.getNInData() == b.getNInData() &&
a.getNInNacks() == b.getNInNacks() &&
a.getNOutInterests() == b.getNOutInterests() &&
- a.getNOutDatas() == b.getNOutDatas() &&
+ a.getNOutData() == b.getNOutData() &&
a.getNOutNacks() == b.getNOutNacks() &&
a.getNInBytes() == b.getNInBytes() &&
a.getNOutBytes() == b.getNOutBytes();
@@ -377,8 +365,8 @@
<< " Flags: " << AsHex{status.getFlags()} << ",\n"
<< " Counters: {Interests: {in: " << status.getNInInterests() << ", "
<< "out: " << status.getNOutInterests() << "},\n"
- << " Data: {in: " << status.getNInDatas() << ", "
- << "out: " << status.getNOutDatas() << "},\n"
+ << " Data: {in: " << status.getNInData() << ", "
+ << "out: " << status.getNOutData() << "},\n"
<< " Nacks: {in: " << status.getNInNacks() << ", "
<< "out: " << status.getNOutNacks() << "},\n"
<< " bytes: {in: " << status.getNInBytes() << ", "
diff --git a/src/mgmt/nfd/face-status.hpp b/src/mgmt/nfd/face-status.hpp
index 32c2607..1051e65 100644
--- a/src/mgmt/nfd/face-status.hpp
+++ b/src/mgmt/nfd/face-status.hpp
@@ -87,13 +87,27 @@
setNInInterests(uint64_t nInInterests);
uint64_t
- getNInDatas() const
+ getNInData() const
{
return m_nInData;
}
+ DEPRECATED(
+ uint64_t
+ getNInDatas() const)
+ {
+ return getNInData();
+ }
+
FaceStatus&
- setNInDatas(uint64_t nInData);
+ setNInData(uint64_t nInData);
+
+ DEPRECATED(
+ FaceStatus&
+ setNInDatas(uint64_t nInData))
+ {
+ return setNInData(nInData);
+ }
uint64_t
getNInNacks() const
@@ -114,13 +128,27 @@
setNOutInterests(uint64_t nOutInterests);
uint64_t
- getNOutDatas() const
+ getNOutData() const
{
return m_nOutData;
}
+ DEPRECATED(
+ uint64_t
+ getNOutDatas() const)
+ {
+ return getNOutData();
+ }
+
FaceStatus&
- setNOutDatas(uint64_t nOutData);
+ setNOutData(uint64_t nOutData);
+
+ DEPRECATED(
+ FaceStatus&
+ setNOutDatas(uint64_t nOutData))
+ {
+ return setNOutData(nOutData);
+ }
uint64_t
getNOutNacks() const
diff --git a/src/mgmt/nfd/forwarder-status.cpp b/src/mgmt/nfd/forwarder-status.cpp
index fbb6c73..06c8f1f 100644
--- a/src/mgmt/nfd/forwarder-status.cpp
+++ b/src/mgmt/nfd/forwarder-status.cpp
@@ -37,10 +37,10 @@
, m_nMeasurementsEntries(0)
, m_nCsEntries(0)
, m_nInInterests(0)
- , m_nInDatas(0)
+ , m_nInData(0)
, m_nInNacks(0)
, m_nOutInterests(0)
- , m_nOutDatas(0)
+ , m_nOutData(0)
, m_nOutNacks(0)
{
}
@@ -56,28 +56,17 @@
{
size_t totalLength = 0;
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutNacks,
- m_nOutNacks);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutDatas,
- m_nOutDatas);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutInterests,
- m_nOutInterests);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInNacks,
- m_nInNacks);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInDatas,
- m_nInDatas);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInInterests,
- m_nInInterests);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NCsEntries,
- m_nCsEntries);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NMeasurementsEntries,
- m_nMeasurementsEntries);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NPitEntries,
- m_nPitEntries);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NFibEntries,
- m_nFibEntries);
- totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NNameTreeEntries,
- m_nNameTreeEntries);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutNacks, m_nOutNacks);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutData, m_nOutData);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NOutInterests, m_nOutInterests);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInNacks, m_nInNacks);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInData, m_nInData);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInInterests, m_nInInterests);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NCsEntries, m_nCsEntries);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NMeasurementsEntries, m_nMeasurementsEntries);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NPitEntries, m_nPitEntries);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NFibEntries, m_nFibEntries);
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NNameTreeEntries, m_nNameTreeEntries);
totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::CurrentTimestamp,
time::toUnixTimestamp(m_currentTimestamp).count());
totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::StartTimestamp,
@@ -195,12 +184,12 @@
BOOST_THROW_EXCEPTION(Error("missing required NInInterests field"));
}
- if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInDatas) {
- m_nInDatas = static_cast<uint64_t>(readNonNegativeInteger(*val));
+ if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInData) {
+ m_nInData = static_cast<uint64_t>(readNonNegativeInteger(*val));
++val;
}
else {
- BOOST_THROW_EXCEPTION(Error("missing required NInDatas field"));
+ BOOST_THROW_EXCEPTION(Error("missing required NInData field"));
}
if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInNacks) {
@@ -219,12 +208,12 @@
BOOST_THROW_EXCEPTION(Error("missing required NOutInterests field"));
}
- if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutDatas) {
- m_nOutDatas = static_cast<uint64_t>(readNonNegativeInteger(*val));
+ if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutData) {
+ m_nOutData = static_cast<uint64_t>(readNonNegativeInteger(*val));
++val;
}
else {
- BOOST_THROW_EXCEPTION(Error("missing required NOutDatas field"));
+ BOOST_THROW_EXCEPTION(Error("missing required NOutData field"));
}
if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutNacks) {
@@ -232,7 +221,7 @@
++val;
}
else {
- BOOST_THROW_EXCEPTION(Error("missing required NInNacks field"));
+ BOOST_THROW_EXCEPTION(Error("missing required NOutNacks field"));
}
}
@@ -309,10 +298,10 @@
}
ForwarderStatus&
-ForwarderStatus::setNInDatas(uint64_t nInDatas)
+ForwarderStatus::setNInData(uint64_t nInData)
{
m_wire.reset();
- m_nInDatas = nInDatas;
+ m_nInData = nInData;
return *this;
}
@@ -333,10 +322,10 @@
}
ForwarderStatus&
-ForwarderStatus::setNOutDatas(uint64_t nOutDatas)
+ForwarderStatus::setNOutData(uint64_t nOutData)
{
m_wire.reset();
- m_nOutDatas = nOutDatas;
+ m_nOutData = nOutData;
return *this;
}
@@ -360,10 +349,10 @@
a.getNMeasurementsEntries() == b.getNMeasurementsEntries() &&
a.getNCsEntries() == b.getNCsEntries() &&
a.getNInInterests() == b.getNInInterests() &&
- a.getNInDatas() == b.getNInDatas() &&
+ a.getNInData() == b.getNInData() &&
a.getNInNacks() == b.getNInNacks() &&
a.getNOutInterests() == b.getNOutInterests() &&
- a.getNOutDatas() == b.getNOutDatas() &&
+ a.getNOutData() == b.getNOutData() &&
a.getNOutNacks() == b.getNOutNacks();
}
@@ -380,8 +369,8 @@
<< " CsEntries: " << status.getNCsEntries() << ",\n"
<< " Interests: {in: " << status.getNInInterests() << ", "
<< "out: " << status.getNOutInterests() << "},\n"
- << " Data: {in: " << status.getNInDatas() << ", "
- << "out: " << status.getNOutDatas() << "},\n"
+ << " Data: {in: " << status.getNInData() << ", "
+ << "out: " << status.getNOutData() << "},\n"
<< " Nacks: {in: " << status.getNInNacks() << ", "
<< "out: " << status.getNOutNacks() << "}}\n"
<< " )";
diff --git a/src/mgmt/nfd/forwarder-status.hpp b/src/mgmt/nfd/forwarder-status.hpp
index 7e1b35c..58403f8 100644
--- a/src/mgmt/nfd/forwarder-status.hpp
+++ b/src/mgmt/nfd/forwarder-status.hpp
@@ -156,13 +156,27 @@
setNInInterests(uint64_t nInInterests);
uint64_t
- getNInDatas() const
+ getNInData() const
{
- return m_nInDatas;
+ return m_nInData;
+ }
+
+ DEPRECATED(
+ uint64_t
+ getNInDatas() const)
+ {
+ return getNInData();
}
ForwarderStatus&
- setNInDatas(uint64_t nInDatas);
+ setNInData(uint64_t nInData);
+
+ DEPRECATED(
+ ForwarderStatus&
+ setNInDatas(uint64_t nInData))
+ {
+ return setNInData(nInData);
+ }
uint64_t
getNInNacks() const
@@ -183,13 +197,27 @@
setNOutInterests(uint64_t nOutInterests);
uint64_t
- getNOutDatas() const
+ getNOutData() const
{
- return m_nOutDatas;
+ return m_nOutData;
+ }
+
+ DEPRECATED(
+ uint64_t
+ getNOutDatas() const)
+ {
+ return getNOutData();
}
ForwarderStatus&
- setNOutDatas(uint64_t nOutDatas);
+ setNOutData(uint64_t nOutData);
+
+ DEPRECATED(
+ ForwarderStatus&
+ setNOutDatas(uint64_t nOutData))
+ {
+ return setNOutData(nOutData);
+ }
uint64_t
getNOutNacks() const
@@ -210,10 +238,10 @@
size_t m_nMeasurementsEntries;
size_t m_nCsEntries;
uint64_t m_nInInterests;
- uint64_t m_nInDatas;
+ uint64_t m_nInData;
uint64_t m_nInNacks;
uint64_t m_nOutInterests;
- uint64_t m_nOutDatas;
+ uint64_t m_nOutData;
uint64_t m_nOutNacks;
mutable Block m_wire;