nlsr: Don't use ndn aliases provided by ndn-cxx/common.hpp
refs: #3983
Change-Id: I31da8d68e0285dcfe9c7d3e5e678c00397d22bef
diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 4b732a4..fd2fd46 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -235,8 +235,8 @@
{
std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
m_adjList.end(),
- ndn::bind(&Adjacent::compare,
- _1, ndn::cref(adjName)));
+ std::bind(&Adjacent::compare,
+ _1, std::cref(adjName)));
return it;
}
@@ -245,8 +245,8 @@
{
std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
m_adjList.end(),
- ndn::bind(&Adjacent::compare,
- _1, ndn::cref(adjName)));
+ std::bind(&Adjacent::compare,
+ _1, std::cref(adjName)));
if (it != m_adjList.end()) {
return &(*it);
}
@@ -259,7 +259,7 @@
{
std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
m_adjList.end(),
- ndn::bind(&Adjacent::compareFaceId,
+ std::bind(&Adjacent::compareFaceId,
_1, faceId));
if (it != m_adjList.end()) {
return &(*it);
@@ -273,7 +273,7 @@
{
std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
m_adjList.end(),
- ndn::bind(&Adjacent::compareFaceUri,
+ std::bind(&Adjacent::compareFaceUri,
_1, faceUri));
if (it != m_adjList.end()) {
return it->getFaceId();
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 7c00d37..0e40809 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -69,7 +69,7 @@
int32_t lsaPosition = util::getNameComponentPosition(m_name, LSA_COMPONENT);
if (nlsrPosition < 0 || lsaPosition < 0) {
- throw Error("Cannot parse update name because expected components are missing");
+ BOOST_THROW_EXCEPTION(Error("Cannot parse update name because expected components are missing"));
}
ndn::Name networkName = m_name.getSubName(1, nlsrPosition-1);
@@ -154,12 +154,12 @@
// The face's lifetime is managed in main.cpp; SyncSocket should not manage the memory
// of the object
- ndn::shared_ptr<ndn::Face> facePtr(&m_syncFace, NullDeleter<ndn::Face>());
+ std::shared_ptr<ndn::Face> facePtr(&m_syncFace, NullDeleter<ndn::Face>());
- m_syncSocket = ndn::make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator, facePtr,
- ndn::bind(&SyncLogicHandler::onNsyncUpdate,
+ m_syncSocket = std::make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator, facePtr,
+ std::bind(&SyncLogicHandler::onNsyncUpdate,
this, _1, _2),
- ndn::bind(&SyncLogicHandler::onNsyncRemoval,
+ std::bind(&SyncLogicHandler::onNsyncRemoval,
this, _1));
}
@@ -191,7 +191,7 @@
try {
originRouter = update.getOriginRouter();
}
- catch (std::exception& e) {
+ catch (const std::exception& e) {
_LOG_WARN("Received malformed sync update");
return;
}
@@ -275,7 +275,7 @@
if (m_syncSocket == nullptr) {
_LOG_FATAL("Cannot publish routing update; SyncSocket does not exist");
- throw SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist");
+ BOOST_THROW_EXCEPTION(SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist"));
}
m_sequencingManager.writeSeqNoToFile();
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 955a9c1..5e0e6a8 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -29,6 +29,7 @@
#include <iostream>
#include <unistd.h>
#include <boost/cstdint.hpp>
+#include <boost/throw_exception.hpp>
#include "test-access-control.hpp"
@@ -90,9 +91,9 @@
publishSyncUpdate(const ndn::Name& updatePrefix, uint64_t seqNo);
private:
- ndn::shared_ptr<ndn::ValidatorNull> m_validator;
+ std::shared_ptr<ndn::ValidatorNull> m_validator;
ndn::Face& m_syncFace;
- ndn::shared_ptr<Sync::SyncSocket> m_syncSocket;
+ std::shared_ptr<Sync::SyncSocket> m_syncSocket;
ndn::Name m_syncPrefix;
private:
@@ -111,4 +112,4 @@
} // namespace nlsr
-#endif //NLSR_SYNC_LOGIC_HANDLER_HPP
+#endif // NLSR_SYNC_LOGIC_HANDLER_HPP
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index 8621a02..70600fb 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -45,7 +45,7 @@
class ConfigurationVariable
{
public:
- typedef ndn::function<void(T)> ConfParameterCallback;
+ typedef std::function<void(T)> ConfParameterCallback;
typedef boost::property_tree::ptree ConfigSection;
ConfigurationVariable(const std::string& key, const ConfParameterCallback& setter)
@@ -446,7 +446,7 @@
// Event intervals
// adj-lsa-build-interval
ConfigurationVariable<uint32_t> adjLsaBuildInterval("adj-lsa-build-interval",
- bind(&ConfParameter::setAdjLsaBuildInterval,
+ std::bind(&ConfParameter::setAdjLsaBuildInterval,
&m_nlsr.getConfParameter(), _1));
adjLsaBuildInterval.setMinAndMaxValue(ADJ_LSA_BUILD_INTERVAL_MIN, ADJ_LSA_BUILD_INTERVAL_MAX);
adjLsaBuildInterval.setOptional(ADJ_LSA_BUILD_INTERVAL_DEFAULT);
@@ -457,7 +457,7 @@
// first-hello-interval
ConfigurationVariable<uint32_t> firstHelloInterval("first-hello-interval",
- bind(&ConfParameter::setFirstHelloInterval,
+ std::bind(&ConfParameter::setFirstHelloInterval,
&m_nlsr.getConfParameter(), _1));
firstHelloInterval.setMinAndMaxValue(FIRST_HELLO_INTERVAL_MIN, FIRST_HELLO_INTERVAL_MAX);
firstHelloInterval.setOptional(FIRST_HELLO_INTERVAL_DEFAULT);
@@ -569,7 +569,7 @@
// routing-calc-interval
ConfigurationVariable<uint32_t> routingCalcInterval("routing-calc-interval",
- bind(&ConfParameter::setRoutingCalcInterval,
+ std::bind(&ConfParameter::setRoutingCalcInterval,
&m_nlsr.getConfParameter(), _1));
routingCalcInterval.setMinAndMaxValue(ROUTING_CALC_INTERVAL_MIN, ROUTING_CALC_INTERVAL_MAX);
routingCalcInterval.setOptional(ROUTING_CALC_INTERVAL_DEFAULT);
@@ -635,7 +635,7 @@
std::string file = it->second.data();
path certfilePath = absolute(file, path(m_confFileName).parent_path());
- shared_ptr<ndn::IdentityCertificate> idCert =
+ std::shared_ptr<ndn::IdentityCertificate> idCert =
ndn::io::load<ndn::IdentityCertificate>(certfilePath.string());
if (idCert == nullptr) {
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index c8fc724..5e29223 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -42,10 +42,10 @@
i.setInterestLifetime(ndn::time::seconds(seconds));
i.setMustBeFresh(true);
m_nlsr.getNlsrFace().expressInterest(i,
- ndn::bind(&HelloProtocol::onContent,
+ std::bind(&HelloProtocol::onContent,
this,
_1, _2),
- ndn::bind(&HelloProtocol::processInterestTimedOut,
+ std::bind(&HelloProtocol::processInterestTimedOut,
this, _1));
}
@@ -57,7 +57,7 @@
++it) {
// If this adjacency has a Face, just proceed as usual.
if((*it).getFaceId() != 0) {
- /* interest name: /<neighbor>/NLSR/INFO/<router> */
+ // interest name: /<neighbor>/NLSR/INFO/<router>
ndn::Name interestName = (*it).getName() ;
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
@@ -82,14 +82,14 @@
_LOG_DEBUG("Scheduling HELLO Interests in " << ndn::time::seconds(seconds));
m_scheduler.scheduleEvent(ndn::time::seconds(seconds),
- ndn::bind(&HelloProtocol::sendScheduledInterest, this, seconds));
+ std::bind(&HelloProtocol::sendScheduledInterest, this, seconds));
}
void
HelloProtocol::processInterest(const ndn::Name& name,
const ndn::Interest& interest)
{
- /* interest name: /<neighbor>/NLSR/INFO/<router> */
+ // interest name: /<neighbor>/NLSR/INFO/<router>
const ndn::Name interestName = interest.getName();
_LOG_DEBUG("Interest Received for Name: " << interestName);
if (interestName.get(-2).toUri() != INFO_COMPONENT) {
@@ -99,7 +99,7 @@
neighbor.wireDecode(interestName.get(-1).blockFromValue());
_LOG_DEBUG("Neighbor: " << neighbor);
if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) {
- ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+ std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
data->setName(ndn::Name(interest.getName()).appendVersion());
data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
@@ -112,7 +112,7 @@
if (adjacent->getStatus() == Adjacent::STATUS_INACTIVE) {
// We can only do that if the neighbor currently has a face.
if(adjacent->getFaceId() != 0){
- /* interest name: /<neighbor>/NLSR/INFO/<router> */
+ // interest name: /<neighbor>/NLSR/INFO/<router>
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
@@ -133,7 +133,7 @@
void
HelloProtocol::processInterestTimedOut(const ndn::Interest& interest)
{
- /* interest name: /<neighbor>/NLSR/INFO/<router> */
+ // interest name: /<neighbor>/NLSR/INFO/<router>
const ndn::Name interestName(interest.getName());
_LOG_DEBUG("Interest timed out for Name: " << interestName);
if (interestName.get(-2).toUri() != INFO_COMPONENT) {
@@ -150,7 +150,7 @@
_LOG_DEBUG("Status: " << status);
_LOG_DEBUG("Info Interest Timed out: " << infoIntTimedOutCount);
if ((infoIntTimedOutCount < m_nlsr.getConfParameter().getInterestRetryNumber())) {
- /* interest name: /<neighbor>/NLSR/INFO/<router> */
+ // interest name: /<neighbor>/NLSR/INFO/<router>
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
@@ -179,8 +179,8 @@
}
}
m_nlsr.getValidator().validate(data,
- ndn::bind(&HelloProtocol::onContentValidated, this, _1),
- ndn::bind(&HelloProtocol::onContentValidationFailed,
+ std::bind(&HelloProtocol::onContentValidated, this, _1),
+ std::bind(&HelloProtocol::onContentValidationFailed,
this, _1, _2));
}
@@ -190,9 +190,9 @@
// LSA. If there was a change in status, we schedule an adjacency
// LSA build.
void
-HelloProtocol::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
+HelloProtocol::onContentValidated(const std::shared_ptr<const ndn::Data>& data)
{
- /* data name: /<neighbor>/NLSR/INFO/<router>/<version> */
+ // data name: /<neighbor>/NLSR/INFO/<router>/<version>
ndn::Name dataName = data->getName();
_LOG_DEBUG("Data validation successful for INFO(name): " << dataName);
if (dataName.get(-3).toUri() == INFO_COMPONENT) {
@@ -220,7 +220,7 @@
// Simply logs a debug message that the content could not be
// validated (and is implicitly being discarded as a result).
void
-HelloProtocol::onContentValidationFailed(const ndn::shared_ptr<const ndn::Data>& data,
+HelloProtocol::onContentValidationFailed(const std::shared_ptr<const ndn::Data>& data,
const std::string& msg)
{
_LOG_DEBUG("Validation Error: " << msg);
@@ -235,9 +235,9 @@
{
m_nlsr.getFib().registerPrefix(adjName, faceUri, linkCost, timeout,
ndn::nfd::ROUTE_FLAG_CAPTURE, 0,
- ndn::bind(&HelloProtocol::onRegistrationSuccess,
+ std::bind(&HelloProtocol::onRegistrationSuccess,
this, _1, adjName,timeout),
- ndn::bind(&HelloProtocol::onRegistrationFailure,
+ std::bind(&HelloProtocol::onRegistrationFailure,
this, _1, adjName));
}
@@ -266,7 +266,7 @@
ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
// Sends a Hello Interest to determine status before the next scheduled.
- /* interest name: /<neighbor>/NLSR/INFO/<router> */
+ // interest name: /<neighbor>/NLSR/INFO/<router>
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp
index c0a489a..1817850 100644
--- a/src/hello-protocol.hpp
+++ b/src/hello-protocol.hpp
@@ -102,11 +102,11 @@
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
void
- onContentValidated(const ndn::shared_ptr<const ndn::Data>& data);
+ onContentValidated(const std::shared_ptr<const ndn::Data>& data);
private:
void
- onContentValidationFailed(const ndn::shared_ptr<const ndn::Data>& data,
+ onContentValidationFailed(const std::shared_ptr<const ndn::Data>& data,
const std::string& msg);
void
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 179751a..1d20d72 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -107,7 +107,7 @@
void
Lsdb::afterFetchLsa(const ndn::ConstBufferPtr& bufferPtr, ndn::Name& interestName)
{
- shared_ptr<ndn::Data> data = make_shared<ndn::Data>(ndn::Name(interestName));
+ std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(ndn::Name(interestName));
data->setContent(bufferPtr);
_LOG_DEBUG("Received data for LSA(name): " << data->getName());
@@ -161,7 +161,7 @@
{
std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
m_nameLsdb.end(),
- bind(nameLsaCompareByKey, _1, key));
+ std::bind(nameLsaCompareByKey, _1, key));
if (it != m_nameLsdb.end()) {
return &(*it);
}
@@ -190,7 +190,7 @@
const ndn::time::seconds& expTime)
{
return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
- ndn::bind(&Lsdb::exprireOrRefreshNameLsa, this, key, seqNo));
+ std::bind(&Lsdb::exprireOrRefreshNameLsa, this, key, seqNo));
}
bool
@@ -294,7 +294,7 @@
{
std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
m_nameLsdb.end(),
- bind(nameLsaCompareByKey, _1,
+ std::bind(nameLsaCompareByKey, _1,
nlsa.getKey()));
if (it == m_nameLsdb.end()) {
m_nameLsdb.push_back(nlsa);
@@ -308,7 +308,7 @@
{
std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
m_nameLsdb.end(),
- ndn::bind(nameLsaCompareByKey, _1, key));
+ std::bind(nameLsaCompareByKey, _1, key));
if (it != m_nameLsdb.end()) {
_LOG_DEBUG("Deleting Name Lsa");
(*it).writeLog();
@@ -336,7 +336,7 @@
{
std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
m_nameLsdb.end(),
- ndn::bind(nameLsaCompareByKey, _1, key));
+ std::bind(nameLsaCompareByKey, _1, key));
if (it == m_nameLsdb.end()) {
return false;
}
@@ -396,7 +396,7 @@
{
std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
m_corLsdb.end(),
- ndn::bind(corLsaCompareByKey, _1, key));
+ std::bind(corLsaCompareByKey, _1, key));
if (it != m_corLsdb.end()) {
return &(*it);
}
@@ -429,7 +429,7 @@
const ndn::time::seconds& expTime)
{
return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
- ndn::bind(&Lsdb::exprireOrRefreshCoordinateLsa,
+ std::bind(&Lsdb::exprireOrRefreshCoordinateLsa,
this, key, seqNo));
}
@@ -500,7 +500,7 @@
{
std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
m_corLsdb.end(),
- ndn::bind(corLsaCompareByKey, _1,
+ std::bind(corLsaCompareByKey, _1,
clsa.getKey()));
if (it == m_corLsdb.end()) {
m_corLsdb.push_back(clsa);
@@ -514,7 +514,7 @@
{
std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
m_corLsdb.end(),
- ndn::bind(corLsaCompareByKey,
+ std::bind(corLsaCompareByKey,
_1, key));
if (it != m_corLsdb.end()) {
_LOG_DEBUG("Deleting Coordinate Lsa");
@@ -535,7 +535,7 @@
{
std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
m_corLsdb.end(),
- ndn::bind(corLsaCompareByKey,
+ std::bind(corLsaCompareByKey,
_1, key));
if (it == m_corLsdb.end()) {
return false;
@@ -584,7 +584,7 @@
if (m_nlsr.getIsBuildAdjLsaSheduled() == false) {
_LOG_DEBUG("Scheduling Adjacency LSA build in " << m_adjLsaBuildInterval);
- m_scheduler.scheduleEvent(m_adjLsaBuildInterval, ndn::bind(&Lsdb::buildAdjLsa, this));
+ m_scheduler.scheduleEvent(m_adjLsaBuildInterval, std::bind(&Lsdb::buildAdjLsa, this));
m_nlsr.setIsBuildAdjLsaSheduled(true);
}
}
@@ -611,7 +611,7 @@
// router from refreshing the LSA, eventually causing other
// routers to delete it, too.
else {
- _LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors")
+ _LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors");
// Get this router's key
ndn::Name key = m_nlsr.getConfParameter().getRouterPrefix();
key.append(AdjLsa::TYPE_STRING);
@@ -634,7 +634,7 @@
int schedulingTime = m_nlsr.getConfParameter().getInterestRetryNumber() *
m_nlsr.getConfParameter().getInterestResendTime();
m_scheduler.scheduleEvent(ndn::time::seconds(schedulingTime),
- ndn::bind(&Lsdb::buildAdjLsa, this));
+ std::bind(&Lsdb::buildAdjLsa, this));
}
}
@@ -643,7 +643,7 @@
{
std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
m_adjLsdb.end(),
- bind(adjLsaCompareByKey, _1,
+ std::bind(adjLsaCompareByKey, _1,
alsa.getKey()));
if (it == m_adjLsdb.end()) {
m_adjLsdb.push_back(alsa);
@@ -657,7 +657,7 @@
{
std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
m_adjLsdb.end(),
- bind(adjLsaCompareByKey, _1, key));
+ std::bind(adjLsaCompareByKey, _1, key));
if (it != m_adjLsdb.end()) {
return &(*it);
}
@@ -686,7 +686,7 @@
const ndn::time::seconds& expTime)
{
return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
- ndn::bind(&Lsdb::exprireOrRefreshAdjLsa, this, key, seqNo));
+ std::bind(&Lsdb::exprireOrRefreshAdjLsa, this, key, seqNo));
}
bool
@@ -766,7 +766,7 @@
{
std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
m_adjLsdb.end(),
- ndn::bind(adjLsaCompareByKey, _1, key));
+ std::bind(adjLsaCompareByKey, _1, key));
if (it != m_adjLsdb.end()) {
_LOG_DEBUG("Deleting Adj Lsa");
(*it).writeLog();
@@ -782,7 +782,7 @@
{
std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
m_adjLsdb.end(),
- bind(adjLsaCompareByKey, _1, key));
+ std::bind(adjLsaCompareByKey, _1, key));
if (it == m_adjLsdb.end()) {
return false;
}
@@ -979,8 +979,8 @@
_LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo);
ndn::util::SegmentFetcher::fetch(m_nlsr.getNlsrFace(), interest,
m_nlsr.getValidator(),
- ndn::bind(&Lsdb::afterFetchLsa, this, _1, interestName),
- ndn::bind(&Lsdb::onFetchLsaError, this, _1, _2, interestName,
+ std::bind(&Lsdb::afterFetchLsa, this, _1, interestName),
+ std::bind(&Lsdb::onFetchLsaError, this, _1, _2, interestName,
timeoutCount, deadline, lsaName, seqNo));
}
@@ -1101,7 +1101,7 @@
}
void
-Lsdb::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
+Lsdb::onContentValidated(const std::shared_ptr<const ndn::Data>& data)
{
const ndn::Name& dataName = data->getName();
_LOG_DEBUG("Data validation successful for LSA: " << dataName);
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index c4283a1..a2d42cd 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -303,7 +303,7 @@
const ndn::Name& lsaKey,
uint64_t seqNo);
void
- onContentValidated(const ndn::shared_ptr<const ndn::Data>& data);
+ onContentValidated(const std::shared_ptr<const ndn::Data>& data);
void
processContentNameLsa(const ndn::Name& lsaKey,
@@ -387,4 +387,4 @@
} // namespace nlsr
-#endif //NLSR_LSDB_HPP
+#endif // NLSR_LSDB_HPP
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index 188d5f3..37c66dc 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.cpp
@@ -53,8 +53,8 @@
{
std::list<ndn::Name>::iterator it = std::find_if(m_nameList.begin(),
m_nameList.end(),
- ndn::bind(&nameCompare, _1 ,
- ndn::cref(name)));
+ std::bind(&nameCompare, _1 ,
+ std::cref(name)));
if (it != m_nameList.end()) {
return false;
}
@@ -67,8 +67,8 @@
{
std::list<ndn::Name>::iterator it = std::find_if(m_nameList.begin(),
m_nameList.end(),
- ndn::bind(&nameCompare, _1 ,
- ndn::cref(name)));
+ std::bind(&nameCompare, _1 ,
+ std::cref(name)));
if (it != m_nameList.end()) {
m_nameList.erase(it);
return true;
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 132f297..2a57e0f 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -76,15 +76,15 @@
, m_faceMonitor(m_nlsrFace)
, m_firstHelloInterval(FIRST_HELLO_INTERVAL_DEFAULT)
{
- m_faceMonitor.onNotification.connect(bind(&Nlsr::onFaceEventNotification, this, _1));
+ m_faceMonitor.onNotification.connect(std::bind(&Nlsr::onFaceEventNotification, this, _1));
m_faceMonitor.start();
}
void
Nlsr::registrationFailed(const ndn::Name& name)
{
- std::cerr << "ERROR: Failed to register prefix in local hub's daemon" << endl;
- throw Error("Error: Prefix registration failed");
+ std::cerr << "ERROR: Failed to register prefix in local hub's daemon" << std::endl;
+ BOOST_THROW_EXCEPTION(Error("Error: Prefix registration failed"));
}
void
@@ -157,7 +157,7 @@
process_id = fork();
if (process_id < 0){
std::cerr << "Daemonization failed!" << std::endl;
- throw Error("Error: Daemonization process- fork failed!");
+ BOOST_THROW_EXCEPTION(Error("Error: Daemonization process- fork failed!"));
}
if (process_id > 0) {
_LOG_DEBUG("Process daemonized. Process id: " << process_id);
@@ -167,11 +167,11 @@
umask(0);
sid = setsid();
if(sid < 0) {
- throw Error("Error: Daemonization process- setting id failed!");
+ BOOST_THROW_EXCEPTION(Error("Error: Daemonization process- setting id failed!"));
}
if (chdir("/") < 0) {
- throw Error("Error: Daemonization process-chdir failed!");
+ BOOST_THROW_EXCEPTION(Error("Error: Daemonization process-chdir failed!"));
}
}
@@ -189,11 +189,11 @@
m_syncLogicHandler.createSyncSocket(m_confParam.getChronosyncPrefix());
- /* Logging start */
+ // Logging start
m_confParam.writeLog();
m_adjacencyList.writeLog();
m_namePrefixList.writeLog();
- /* Logging end */
+ // Logging end
initializeKey();
setStrategies();
_LOG_DEBUG("Default NLSR identity: " << m_signingInfo.getSignerName());
@@ -237,15 +237,15 @@
try {
m_keyChain.deleteIdentity(defaultIdentity);
}
- catch (std::exception& e) {
+ catch (const std::exception& e) {
}
m_signingInfo = ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_ID, defaultIdentity);
ndn::Name keyName = m_keyChain.generateRsaKeyPairAsDefault(defaultIdentity, true);
- ndn::shared_ptr<ndn::IdentityCertificate> certificate =
- ndn::make_shared<ndn::IdentityCertificate>();
- ndn::shared_ptr<ndn::PublicKey> pubKey = m_keyChain.getPublicKey(keyName);
+ std::shared_ptr<ndn::IdentityCertificate> certificate =
+ std::make_shared<ndn::IdentityCertificate>();
+ std::shared_ptr<ndn::PublicKey> pubKey = m_keyChain.getPublicKey(keyName);
Name certificateName = keyName.getPrefix(-1);
certificateName.append("KEY").append(keyName.get(-1)).append("ID-CERT").appendVersion();
certificate->setName(certificateName);
@@ -310,12 +310,12 @@
else if (certName[-1].toUri() != "ID-CERT")
return; //Wrong key interest.
- ndn::shared_ptr<const ndn::IdentityCertificate> cert = getCertificate(certName);
+ std::shared_ptr<const ndn::IdentityCertificate> cert = getCertificate(certName);
if (!static_cast<bool>(cert))
return; // cert is not found
- ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+ std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
data->setName(interestName);
data->setContent(cert->wireEncode());
m_keyChain.signWithSha256(*data);
@@ -337,7 +337,7 @@
Nlsr::onDestroyFaceFailure(const ndn::nfd::ControlResponse& response)
{
std::cerr << response.getText() << " (code: " << response.getCode() << ")";
- throw Error("Error: Face destruction failed");
+ BOOST_THROW_EXCEPTION(Error("Error: Face destruction failed"));
}
void
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 705cc76..5399ed8 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -19,11 +19,12 @@
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
**/
-#ifndef NLSR_HPP
-#define NLSR_HPP
+#ifndef NLSR_NLSR_HPP
+#define NLSR_NLSR_HPP
#include <boost/cstdint.hpp>
#include <stdexcept>
+#include <boost/throw_exception.hpp>
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>
@@ -253,12 +254,12 @@
}
void
- loadCertToPublish(ndn::shared_ptr<ndn::IdentityCertificate> certificate)
+ loadCertToPublish(std::shared_ptr<ndn::IdentityCertificate> certificate)
{
m_certStore.insert(certificate);
}
- ndn::shared_ptr<const ndn::IdentityCertificate>
+ std::shared_ptr<const ndn::IdentityCertificate>
getCertificate(const ndn::Name& certificateNameWithoutVersion)
{
shared_ptr<const ndn::IdentityCertificate> cert =
@@ -317,7 +318,7 @@
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
void
- addCertificateToCache(ndn::shared_ptr<ndn::IdentityCertificate> certificate)
+ addCertificateToCache(std::shared_ptr<ndn::IdentityCertificate> certificate)
{
if (certificate != nullptr) {
m_certificateCache->insertCertificate(certificate);
@@ -386,7 +387,7 @@
HelloProtocol m_helloProtocol;
private:
- ndn::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache;
+ std::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache;
security::CertificateStore m_certStore;
Validator m_validator;
ndn::security::SigningInfo m_signingInfo;
@@ -401,4 +402,4 @@
} // namespace nlsr
-#endif //NLSR_HPP
+#endif // NLSR_NLSR_HPP
diff --git a/src/publisher/segment-publisher.hpp b/src/publisher/segment-publisher.hpp
index 43c2efb..82109eb 100644
--- a/src/publisher/segment-publisher.hpp
+++ b/src/publisher/segment-publisher.hpp
@@ -32,10 +32,10 @@
namespace nlsr {
/*! \brief provides a publisher of Status Dataset or other segmented octet stream
- \sa http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+ \sa https://redmine.named-data.net/projects/nfd/wiki/StatusDataset
*/
template <class FaceBase>
-class SegmentPublisher : ndn::noncopyable
+class SegmentPublisher : boost::noncopyable
{
public:
SegmentPublisher(FaceBase& face,
@@ -91,7 +91,7 @@
ndn::Name segmentName(segmentPrefix);
segmentName.appendSegment(segmentNo);
- ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>(segmentName);
+ std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(segmentName);
data->setContent(segmentBegin, segmentEnd - segmentBegin);
data->setFreshnessPeriod(m_freshnessPeriod);
@@ -113,7 +113,7 @@
private:
void
- publishSegment(ndn::shared_ptr<ndn::Data>& data, const ndn::security::SigningInfo& signingInfo)
+ publishSegment(std::shared_ptr<ndn::Data>& data, const ndn::security::SigningInfo& signingInfo)
{
m_keyChain.sign(*data, signingInfo);
m_face.put(*data);
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index d12109d..5de9929 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -53,7 +53,7 @@
_LOG_DEBUG("Fib::scheduleEntryExpiration Called");
_LOG_INFO("Name: " << name << " Seq Num: " << feSeqNum);
- return m_scheduler.scheduleEvent(expTime, ndn::bind(&Fib::remove, this, name));
+ return m_scheduler.scheduleEvent(expTime, std::bind(&Fib::remove, this, name));
}
void
@@ -117,7 +117,7 @@
// See if the nexthop is installed in NFD's FIB
NexthopList::const_iterator foundIt = std::find_if(installedHops.cbegin(),
installedHops.cend(),
- bind(&compareFaceUri, _1, faceUri));
+ std::bind(&compareFaceUri, _1, faceUri));
// The next hop is not installed
if (foundIt == installedHops.cend()) {
@@ -287,7 +287,7 @@
const CommandFailCallback& onFailure)
{
createFace(faceUri,
- ndn::bind(&Fib::destroyFaceInNfd, this, _1, onSuccess, onFailure),
+ std::bind(&Fib::destroyFaceInNfd, this, _1, onSuccess, onFailure),
onFailure);
}
@@ -353,7 +353,7 @@
.setExpirationPeriod(timeout)
.setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
createFace(faceUri,
- ndn::bind(static_cast<RegisterPrefixCallback>(&Fib::registerPrefixInNfd),
+ std::bind(static_cast<RegisterPrefixCallback>(&Fib::registerPrefixInNfd),
this, _1, parameters, times, onSuccess, onFailure),
onFailure);
}
@@ -364,10 +364,10 @@
uint8_t times)
{
m_controller.start<ndn::nfd::RibRegisterCommand>(parameters,
- ndn::bind(&Fib::onRegistration, this, _1,
+ std::bind(&Fib::onRegistration, this, _1,
"Successful in name registration",
faceUri),
- ndn::bind(&Fib::onRegistrationFailure,
+ std::bind(&Fib::onRegistrationFailure,
this, _1,
"Failed in name registration",
parameters,
@@ -406,9 +406,9 @@
.setFaceId(faceId)
.setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
- ndn::bind(&Fib::onUnregistration, this, _1,
+ std::bind(&Fib::onUnregistration, this, _1,
"Successful in unregistering name"),
- ndn::bind(&Fib::onUnregistrationFailure,
+ std::bind(&Fib::onUnregistrationFailure,
this, _1,
"Failed in unregistering name"));
}
@@ -423,9 +423,9 @@
.setStrategy(strategy);
m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
- bind(&Fib::onSetStrategySuccess, this, _1,
+ std::bind(&Fib::onSetStrategySuccess, this, _1,
"Successfully set strategy choice"),
- bind(&Fib::onSetStrategyFailure, this, _1,
+ std::bind(&Fib::onSetStrategyFailure, this, _1,
parameters,
count,
"Failed to set strategy choice"));
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 229b23b..a97be11 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -62,7 +62,7 @@
//cout << mpe;
std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
m_table.end(),
- ndn::bind(&mapEntryCompareByRouter,
+ std::bind(&mapEntryCompareByRouter,
_1, mpe.getRouter()));
if (it == m_table.end()) {
m_table.push_back(mpe);
@@ -76,7 +76,7 @@
{
std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
m_table.end(),
- ndn::bind(&mapEntryCompareByMappingNo,
+ std::bind(&mapEntryCompareByMappingNo,
_1, mn));
if (it != m_table.end()) {
return (*it).getRouter();
@@ -89,7 +89,7 @@
{
std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
m_table.end(),
- ndn::bind(&mapEntryCompareByRouter,
+ std::bind(&mapEntryCompareByRouter,
_1, rName));
if (it != m_table.end()) {
return (*it).getMappingNumber();
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 922b24c..1abc87b 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -43,7 +43,7 @@
}
uint64_t
-NamePrefixTableEntry::removeRoutingTableEntry(shared_ptr<RoutingTablePoolEntry>
+NamePrefixTableEntry::removeRoutingTableEntry(std::shared_ptr<RoutingTablePoolEntry>
rtpePtr)
{
auto rtpeItr = std::find(m_rteList.begin(), m_rteList.end(), rtpePtr);
@@ -60,7 +60,7 @@
}
void
-NamePrefixTableEntry::addRoutingTableEntry(shared_ptr<RoutingTablePoolEntry>
+NamePrefixTableEntry::addRoutingTableEntry(std::shared_ptr<RoutingTablePoolEntry>
rtpePtr)
{
auto rtpeItr = std::find(m_rteList.begin(), m_rteList.end(), rtpePtr);
@@ -105,7 +105,7 @@
{
os << "Name: " << entry.getNamePrefix() << "\n";
- for (const shared_ptr<RoutingTablePoolEntry> rtpePtr : entry.getRteList()) {
+ for (const std::shared_ptr<RoutingTablePoolEntry> rtpePtr : entry.getRteList()) {
os << "Destination: " << rtpePtr->getDestination() << "\n";
}
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index 3c98c0a..6467790 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -141,7 +141,7 @@
// Ensure that the entry exists
NptEntryList::iterator nameItr = std::find_if(m_table.begin(),
m_table.end(),
- bind(&npteCompare, _1, name));
+ std::bind(&npteCompare, _1, name));
if (nameItr != m_table.end()) {
_LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
<< " from prefix: " << *nameItr);
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 2d150dd..c2e5fa6 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -81,7 +81,7 @@
{
std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
m_nexthopList.end(),
- ndn::bind(&nexthopAddCompare, _1, nh));
+ std::bind(&nexthopAddCompare, _1, nh));
if (it == m_nexthopList.end()) {
m_nexthopList.insert(nh);
}
@@ -96,7 +96,7 @@
{
std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
m_nexthopList.end(),
- ndn::bind(&nexthopRemoveCompare, _1, nh));
+ std::bind(&nexthopRemoveCompare, _1, nh));
if (it != m_nexthopList.end()) {
m_nexthopList.erase(it);
}
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index d5d01b9..b553fa1 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -81,4 +81,4 @@
} // namespace nlsr
-#endif //NLSR_ROUTING_TABLE_ENTRY_HPP
+#endif // NLSR_ROUTING_TABLE_ENTRY_HPP
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index e61d4d0..b1e02dc 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -130,7 +130,7 @@
LinkStateRoutingTableCalculator calculator(nRouters);
- calculator.calculatePath(map, ndn::ref(*this), nlsr);
+ calculator.calculatePath(map, std::ref(*this), nlsr);
}
void
@@ -145,7 +145,7 @@
HyperbolicRoutingCalculator calculator(nRouters, false,
nlsr.getConfParameter().getRouterPrefix());
- calculator.calculatePaths(map, ndn::ref(*this),
+ calculator.calculatePaths(map, std::ref(*this),
nlsr.getLsdb(), nlsr.getAdjacencyList());
}
@@ -161,7 +161,7 @@
HyperbolicRoutingCalculator calculator(nRouters, true,
nlsr.getConfParameter().getRouterPrefix());
- calculator.calculatePaths(map, ndn::ref(*this),
+ calculator.calculatePaths(map, std::ref(*this),
nlsr.getLsdb(), nlsr.getAdjacencyList());
}
@@ -172,7 +172,7 @@
_LOG_DEBUG("Scheduling routing table calculation in " << m_routingCalcInterval);
m_scheduler.scheduleEvent(m_routingCalcInterval,
- ndn::bind(&RoutingTable::calculate, this, ndn::ref(pnlsr)));
+ std::bind(&RoutingTable::calculate, this, std::ref(pnlsr)));
pnlsr.setIsRouteCalculationScheduled(true);
}
@@ -205,7 +205,7 @@
{
std::list<RoutingTableEntry>::iterator it = std::find_if(m_rTable.begin(),
m_rTable.end(),
- ndn::bind(&routingTableEntryCompare,
+ std::bind(&routingTableEntryCompare,
_1, destRouter));
if (it != m_rTable.end()) {
return &(*it);
@@ -242,7 +242,7 @@
std::list<RoutingTableEntry>::iterator it = std::find_if(m_dryTable.begin(),
m_dryTable.end(),
- ndn::bind(&routingTableEntryCompare,
+ std::bind(&routingTableEntryCompare,
_1, destRouter));
if (it == m_dryTable.end()) {
RoutingTableEntry rte(destRouter);
diff --git a/src/security/certificate-store.hpp b/src/security/certificate-store.hpp
index a90fc70..a45f0c4 100644
--- a/src/security/certificate-store.hpp
+++ b/src/security/certificate-store.hpp
@@ -35,7 +35,7 @@
{
public:
void
- insert(shared_ptr<ndn::IdentityCertificate> certificate)
+ insert(std::shared_ptr<ndn::IdentityCertificate> certificate)
{
if (certificate != nullptr) {
// Key is cert name without version
@@ -43,7 +43,7 @@
}
}
- shared_ptr<const ndn::IdentityCertificate>
+ std::shared_ptr<const ndn::IdentityCertificate>
find(const ndn::Name& certificateNameWithoutVersion) const
{
CertMap::const_iterator it = m_certificates.find(certificateNameWithoutVersion);
@@ -63,7 +63,7 @@
}
private:
- typedef std::map<ndn::Name, shared_ptr<ndn::IdentityCertificate>> CertMap;
+ typedef std::map<ndn::Name, std::shared_ptr<ndn::IdentityCertificate>> CertMap;
CertMap m_certificates;
};
diff --git a/src/tlv/lsa-info.cpp b/src/tlv/lsa-info.cpp
index 79addb3..8b36ff0 100644
--- a/src/tlv/lsa-info.cpp
+++ b/src/tlv/lsa-info.cpp
@@ -26,7 +26,7 @@
#include <ndn-cxx/encoding/block-helpers.hpp>
namespace nlsr {
-namespace tlv {
+namespace tlv {
BOOST_CONCEPT_ASSERT((ndn::WireEncodable<LsaInfo>));
BOOST_CONCEPT_ASSERT((ndn::WireDecodable<LsaInfo>));
@@ -109,7 +109,7 @@
std::stringstream error;
error << "Expected LsaInfo Block, but Block is of a different type: #"
<< m_wire.type();
- throw Error(error.str());
+ BOOST_THROW_EXCEPTION(Error(error.str()));
}
m_wire.parse();
@@ -124,13 +124,13 @@
m_originRouter.wireDecode(*it);
}
else {
- throw Error("OriginRouter: Missing required Name field");
+ BOOST_THROW_EXCEPTION(Error("OriginRouter: Missing required Name field"));
}
++val;
}
else {
- throw Error("Missing required OriginRouter field");
+ BOOST_THROW_EXCEPTION(Error("Missing required OriginRouter field"));
}
if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::SequenceNumber) {
@@ -138,7 +138,7 @@
++val;
}
else {
- throw Error("Missing required SequenceNumber field");
+ BOOST_THROW_EXCEPTION(Error("Missing required SequenceNumber field"));
}
if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::ExpirationPeriod) {
diff --git a/src/tlv/lsa-info.hpp b/src/tlv/lsa-info.hpp
index c39694b..ef2142a 100644
--- a/src/tlv/lsa-info.hpp
+++ b/src/tlv/lsa-info.hpp
@@ -27,6 +27,7 @@
#include <ndn-cxx/encoding/encoding-buffer.hpp>
#include <ndn-cxx/encoding/tlv.hpp>
#include <ndn-cxx/name.hpp>
+#include <boost/throw_exception.hpp>
#include "lsa.hpp"
@@ -41,7 +42,7 @@
SequenceNumber
ExpirationPeriod?
- \sa http://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
+ \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
*/
class LsaInfo
{
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index 8f3104a..e0c8f3b 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -43,7 +43,7 @@
SyncLogicHandler& sync,
const ndn::Name broadcastPrefix,
ndn::KeyChain& keyChain,
- ndn::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
+ std::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
security::CertificateStore& certStore)
: m_face(face)
, m_namePrefixList(namePrefixList)
@@ -61,7 +61,7 @@
{
_LOG_DEBUG("Setting Interest filter for: " << COMMAND_PREFIX);
- m_face.setInterestFilter(COMMAND_PREFIX, bind(&PrefixUpdateProcessor::onInterest, this, _2));
+ m_face.setInterestFilter(COMMAND_PREFIX, std::bind(&PrefixUpdateProcessor::onInterest, this, _2));
}
void
@@ -75,8 +75,8 @@
}
m_validator.validate(request,
- bind(&PrefixUpdateProcessor::onCommandValidated, this, _1),
- bind(&PrefixUpdateProcessor::onCommandValidationFailed, this, _1, _2));
+ std::bind(&PrefixUpdateProcessor::onCommandValidated, this, _1),
+ std::bind(&PrefixUpdateProcessor::onCommandValidationFailed, this, _1, _2));
}
void
@@ -197,7 +197,7 @@
ndn::MetaInfo metaInfo;
metaInfo.setType(ndn::tlv::ContentType_Nack);
- shared_ptr<ndn::Data> responseData = std::make_shared<ndn::Data>(request.getName());
+ std::shared_ptr<ndn::Data> responseData = std::make_shared<ndn::Data>(request.getName());
responseData->setMetaInfo(metaInfo);
m_keyChain.sign(*responseData);
diff --git a/src/update/prefix-update-processor.hpp b/src/update/prefix-update-processor.hpp
index e91fd1f..b1347b8 100644
--- a/src/update/prefix-update-processor.hpp
+++ b/src/update/prefix-update-processor.hpp
@@ -69,7 +69,7 @@
SyncLogicHandler& sync,
const ndn::Name broadcastPrefix,
ndn::KeyChain& keyChain,
- ndn::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
+ std::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
security::CertificateStore& certStore);
void
diff --git a/src/utility/face-controller.cpp b/src/utility/face-controller.cpp
index 8e680d3..62778cd 100644
--- a/src/utility/face-controller.cpp
+++ b/src/utility/face-controller.cpp
@@ -41,8 +41,8 @@
FaceUri uri(request);
_LOG_TRACE("Converting " << uri << " to canonical form");
- uri.canonize(bind(&FaceController::onCanonizeSuccess, this, _1, onSuccess, onFailure, uri),
- bind(&FaceController::onCanonizeFailure, this, _1, onSuccess, onFailure, uri),
+ uri.canonize(std::bind(&FaceController::onCanonizeSuccess, this, _1, onSuccess, onFailure, uri),
+ std::bind(&FaceController::onCanonizeFailure, this, _1, onSuccess, onFailure, uri),
m_ioService, TIME_ALLOWED_FOR_CANONIZATION);
}
diff --git a/src/validator.hpp b/src/validator.hpp
index ebcd3d0..04b2ea5 100644
--- a/src/validator.hpp
+++ b/src/validator.hpp
@@ -45,7 +45,7 @@
explicit
Validator(ndn::Face& face,
const ndn::Name broadcastPrefix,
- const ndn::shared_ptr<ndn::CertificateCache>& cache,
+ const std::shared_ptr<ndn::CertificateCache>& cache,
security::CertificateStore& certStore,
const int stepLimit = 10)
: ndn::ValidatorConfig(face, cache, ndn::ValidatorConfig::DEFAULT_GRACE_INTERVAL, stepLimit)
@@ -73,7 +73,7 @@
}
protected:
- typedef std::vector<ndn::shared_ptr<ndn::ValidationRequest>> NextSteps;
+ typedef std::vector<std::shared_ptr<ndn::ValidationRequest>> NextSteps;
virtual void
afterCheckPolicy(const NextSteps& nextSteps,
@@ -84,16 +84,16 @@
return;
}
- for (const shared_ptr<ndn::ValidationRequest>& request : nextSteps) {
+ for (const std::shared_ptr<ndn::ValidationRequest>& request : nextSteps) {
ndn::Interest& interest = request->m_interest;
// Look for certificate in permanent storage
- shared_ptr<const ndn::IdentityCertificate> cert = m_certStore.find(interest.getName());
+ std::shared_ptr<const ndn::IdentityCertificate> cert = m_certStore.find(interest.getName());
if (cert != nullptr) {
// If the certificate is found, no reason to express interest
- shared_ptr<ndn::Data> data = make_shared<ndn::Data>(interest.getName());
+ std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(interest.getName());
data->setContent(cert->wireEncode());
Validator::onData(interest, *data, request);
@@ -106,8 +106,8 @@
// Attempt to fetch the certificate
m_face->expressInterest(interest,
- bind(&Validator::onData, this, _1, _2, request),
- bind(&Validator::onTimeout,
+ std::bind(&Validator::onData, this, _1, _2, request),
+ std::bind(&Validator::onTimeout,
this, _1, request->m_nRetries,
onFailure,
request));
@@ -115,10 +115,10 @@
}
}
- virtual ndn::shared_ptr<const ndn::Data>
+ virtual std::shared_ptr<const ndn::Data>
preCertificateValidation(const ndn::Data& data)
{
- ndn::shared_ptr<ndn::Data> internalData = ndn::make_shared<ndn::Data>();
+ std::shared_ptr<ndn::Data> internalData = std::make_shared<ndn::Data>();
internalData->wireDecode(data.getContent().blockFromValue());
return internalData;
}