build+tests: Fixing c++11 mode compilation and correcting integrated test with faces
Change-Id: I32e34d6b2ee8cfd85ec83f62323dd7a51f2238d6
This commit is contained in:
1 parent
c5fdfe772d
commit
b67090ad35
25 files changed
+108
-86
No files matched your search
@@ -26,7 +26,8 @@ def configure(conf):
|
||||
'-g3',
|
||||
'-fcolor-diagnostics', # clang
|
||||
'-fdiagnostics-color', # gcc >= 4.9
|
||||
'-Werror'
|
||||
'-Werror',
|
||||
'-Wno-error=deprecated-register',
|
||||
]
|
||||
if areCustomCxxflagsPresent:
|
||||
missingFlags = [x for x in defaultFlags if x not in conf.env.CXXFLAGS]
|
||||
|
||||
@@ -49,8 +49,8 @@ delayedInterest(Face& face)
|
||||
i.setMustBeFresh(true);
|
||||
|
||||
face.expressInterest(i,
|
||||
bind(&onData, boost::ref(face), _1, _2),
|
||||
bind(&onTimeout, boost::ref(face), _1));
|
||||
bind(&onData, ref(face), _1, _2),
|
||||
bind(&onTimeout, ref(face), _1));
|
||||
}
|
||||
|
||||
int
|
||||
@@ -68,8 +68,8 @@ main(int argc, char** argv)
|
||||
// Create face with io_service object
|
||||
Face face(ioService);
|
||||
face.expressInterest(i,
|
||||
bind(&onData, boost::ref(face), _1, _2),
|
||||
bind(&onTimeout, boost::ref(face), _1));
|
||||
bind(&onData, ref(face), _1, _2),
|
||||
bind(&onTimeout, ref(face), _1));
|
||||
|
||||
|
||||
// Create scheduler object
|
||||
@@ -77,7 +77,7 @@ main(int argc, char** argv)
|
||||
|
||||
// Schedule a new event
|
||||
scheduler.scheduleEvent(time::seconds(2),
|
||||
bind(&delayedInterest, boost::ref(face)));
|
||||
bind(&delayedInterest, ref(face)));
|
||||
|
||||
// ioService.run() will block until all events finished or ioService.stop() is called
|
||||
ioService.run();
|
||||
|
||||
@@ -47,8 +47,8 @@ main(int argc, char** argv)
|
||||
|
||||
Face face;
|
||||
face.expressInterest(i,
|
||||
bind(onData, boost::ref(face), _1, _2),
|
||||
bind(onTimeout, boost::ref(face), _1));
|
||||
bind(onData, ref(face), _1, _2),
|
||||
bind(onTimeout, ref(face), _1));
|
||||
|
||||
// processEvents will block until the requested data received or timeout occurs
|
||||
face.processEvents();
|
||||
|
||||
+15
-1
@@ -82,7 +82,18 @@ using std::const_pointer_cast;
|
||||
|
||||
using std::function;
|
||||
using std::bind;
|
||||
using std::placeholders; // _1, _2, ..
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
using std::placeholders::_3;
|
||||
using std::placeholders::_4;
|
||||
using std::placeholders::_5;
|
||||
using std::placeholders::_6;
|
||||
using std::placeholders::_7;
|
||||
using std::placeholders::_8;
|
||||
using std::placeholders::_9;
|
||||
|
||||
using std::ref;
|
||||
using std::cref;
|
||||
|
||||
} // namespace ndn
|
||||
|
||||
@@ -114,6 +125,9 @@ using boost::const_pointer_cast;
|
||||
using boost::function;
|
||||
using boost::bind;
|
||||
|
||||
using boost::ref;
|
||||
using boost::cref;
|
||||
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_CXX_HAVE_CXX11
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
namespace ndn {
|
||||
|
||||
class Buffer;
|
||||
typedef ptr_lib::shared_ptr<const Buffer> ConstBufferPtr;
|
||||
typedef ptr_lib::shared_ptr<Buffer> BufferPtr;
|
||||
typedef shared_ptr<const Buffer> ConstBufferPtr;
|
||||
typedef shared_ptr<Buffer> BufferPtr;
|
||||
|
||||
/**
|
||||
* @brief Class representing a general-use automatically managed/resized buffer
|
||||
|
||||
+16
-13
@@ -92,8 +92,8 @@ Face::construct(const shared_ptr<Transport>& transport,
|
||||
m_transport = transport;
|
||||
m_ioService = ioService;
|
||||
|
||||
m_pitTimeoutCheckTimer = make_shared<monotonic_deadline_timer>(boost::ref(*m_ioService));
|
||||
m_processEventsTimeoutTimer = make_shared<monotonic_deadline_timer>(boost::ref(*m_ioService));
|
||||
m_pitTimeoutCheckTimer = make_shared<monotonic_deadline_timer>(ref(*m_ioService));
|
||||
m_processEventsTimeoutTimer = make_shared<monotonic_deadline_timer>(ref(*m_ioService));
|
||||
|
||||
std::string protocol = "nrd-0.1";
|
||||
|
||||
@@ -112,15 +112,15 @@ Face::construct(const shared_ptr<Transport>& transport,
|
||||
|
||||
if (isSupportedNrdProtocol(protocol))
|
||||
{
|
||||
m_fwController = make_shared<nrd::Controller>(boost::ref(*this));
|
||||
m_fwController = make_shared<nrd::Controller>(ref(*this));
|
||||
}
|
||||
else if (isSupportedNfdProtocol(protocol))
|
||||
{
|
||||
m_fwController = make_shared<nfd::Controller>(boost::ref(*this));
|
||||
m_fwController = make_shared<nfd::Controller>(ref(*this));
|
||||
}
|
||||
else if (isSupportedNdndProtocol(protocol))
|
||||
{
|
||||
m_fwController = make_shared<ndnd::Controller>(boost::ref(*this));
|
||||
m_fwController = make_shared<ndnd::Controller>(ref(*this));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -135,7 +135,7 @@ Face::expressInterest(const Interest& interest, const OnData& onData, const OnTi
|
||||
m_transport->connect(*m_ioService,
|
||||
bind(&Face::onReceiveElement, this, _1));
|
||||
|
||||
shared_ptr<const Interest> interestToExpress(new Interest(interest));
|
||||
shared_ptr<Interest> interestToExpress(new Interest(interest));
|
||||
|
||||
// If the same ioService thread, dispatch directly calls the method
|
||||
m_ioService->dispatch(bind(&Face::asyncExpressInterest, this,
|
||||
@@ -219,6 +219,12 @@ Face::asyncRemovePendingInterest(const PendingInterestId* pendingInterestId)
|
||||
m_pendingInterestTable.remove_if(MatchPendingInterestId(pendingInterestId));
|
||||
}
|
||||
|
||||
void
|
||||
Face::finalizeSetInterestFilter(const shared_ptr<RegisteredPrefix>& registeredPrefix)
|
||||
{
|
||||
m_registeredPrefixTable.push_back(registeredPrefix);
|
||||
}
|
||||
|
||||
const RegisteredPrefixId*
|
||||
Face::setInterestFilter(const Name& prefix,
|
||||
const OnInterest& onInterest,
|
||||
@@ -227,8 +233,7 @@ Face::setInterestFilter(const Name& prefix,
|
||||
shared_ptr<RegisteredPrefix> prefixToRegister(new RegisteredPrefix(prefix, onInterest));
|
||||
|
||||
m_fwController->selfRegisterPrefix(prefixToRegister->getPrefix(),
|
||||
bind(&RegisteredPrefixTable::push_back,
|
||||
&m_registeredPrefixTable, prefixToRegister),
|
||||
bind(&Face::finalizeSetInterestFilter, this, prefixToRegister),
|
||||
bind(onSetInterestFilterFailed,
|
||||
prefixToRegister->getPrefix(), _1));
|
||||
|
||||
@@ -244,8 +249,7 @@ Face::setInterestFilter(const Name& prefix,
|
||||
shared_ptr<RegisteredPrefix> prefixToRegister(new RegisteredPrefix(prefix, onInterest));
|
||||
|
||||
m_fwController->selfRegisterPrefix(prefixToRegister->getPrefix(),
|
||||
bind(&RegisteredPrefixTable::push_back,
|
||||
&m_registeredPrefixTable, prefixToRegister),
|
||||
bind(&Face::finalizeSetInterestFilter, this, prefixToRegister),
|
||||
bind(onSetInterestFilterFailed,
|
||||
prefixToRegister->getPrefix(), _1),
|
||||
certificate);
|
||||
@@ -262,8 +266,7 @@ Face::setInterestFilter(const Name& prefix,
|
||||
shared_ptr<RegisteredPrefix> prefixToRegister(new RegisteredPrefix(prefix, onInterest));
|
||||
|
||||
m_fwController->selfRegisterPrefix(prefixToRegister->getPrefix(),
|
||||
bind(&RegisteredPrefixTable::push_back,
|
||||
&m_registeredPrefixTable, prefixToRegister),
|
||||
bind(&Face::finalizeSetInterestFilter, this, prefixToRegister),
|
||||
bind(onSetInterestFilterFailed,
|
||||
prefixToRegister->getPrefix(), _1),
|
||||
identity);
|
||||
@@ -380,7 +383,7 @@ Face::processEvents(const time::milliseconds& timeout/* = time::milliseconds::ze
|
||||
|
||||
if (keepThread) {
|
||||
// work will ensure that m_ioService is running until work object exists
|
||||
m_ioServiceWork = make_shared<boost::asio::io_service::work>(boost::ref(*m_ioService));
|
||||
m_ioServiceWork = make_shared<boost::asio::io_service::work>(ref(*m_ioService));
|
||||
}
|
||||
|
||||
m_ioService->run();
|
||||
|
||||
@@ -393,6 +393,9 @@ private:
|
||||
asyncUnsetInterestFilterWithIdentity(const RegisteredPrefixId* registeredPrefixId,
|
||||
const Name& identity);
|
||||
|
||||
void
|
||||
finalizeSetInterestFilter(const shared_ptr<RegisteredPrefix>& registeredPrefix);
|
||||
|
||||
void
|
||||
finalizeUnsetInterestFilter(RegisteredPrefixTable::iterator item);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
start<Command>(parameters, onSuccess, onFailure,
|
||||
bind(&CommandInterestGenerator::generate,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(Name())),
|
||||
Name()),
|
||||
timeout);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
start<Command>(parameters, onSuccess, onFailure,
|
||||
bind(&CommandInterestGenerator::generate,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(certificate.getName())),
|
||||
cref(certificate.getName())),
|
||||
timeout);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
start<Command>(parameters, onSuccess, onFailure,
|
||||
bind(&CommandInterestGenerator::generateWithIdentity,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(identity)),
|
||||
cref(identity)),
|
||||
timeout);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public: // selfreg using FIB Management commands
|
||||
this->selfRegisterPrefix(prefixToRegister, onSuccess, onFail,
|
||||
bind(&CommandInterestGenerator::generate,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(Name())));
|
||||
Name()));
|
||||
}
|
||||
|
||||
virtual void
|
||||
@@ -108,7 +108,7 @@ public: // selfreg using FIB Management commands
|
||||
this->selfRegisterPrefix(prefixToRegister, onSuccess, onFail,
|
||||
bind(&CommandInterestGenerator::generate,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(certificate.getName())));
|
||||
cref(certificate.getName())));
|
||||
}
|
||||
|
||||
virtual void
|
||||
@@ -120,7 +120,7 @@ public: // selfreg using FIB Management commands
|
||||
this->selfRegisterPrefix(prefixToRegister, onSuccess, onFail,
|
||||
bind(&CommandInterestGenerator::generateWithIdentity,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(identity)));
|
||||
cref(identity)));
|
||||
}
|
||||
|
||||
virtual void
|
||||
@@ -131,7 +131,7 @@ public: // selfreg using FIB Management commands
|
||||
this->selfDeregisterPrefix(prefixToDeRegister, onSuccess, onFail,
|
||||
bind(&CommandInterestGenerator::generate,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(Name())));
|
||||
Name()));
|
||||
}
|
||||
|
||||
virtual void
|
||||
@@ -143,7 +143,7 @@ public: // selfreg using FIB Management commands
|
||||
this->selfDeregisterPrefix(prefixToDeRegister, onSuccess, onFail,
|
||||
bind(&CommandInterestGenerator::generate,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(certificate.getName())));
|
||||
cref(certificate.getName())));
|
||||
}
|
||||
|
||||
virtual void
|
||||
@@ -155,7 +155,7 @@ public: // selfreg using FIB Management commands
|
||||
this->selfDeregisterPrefix(prefixToDeRegister, onSuccess, onFail,
|
||||
bind(&CommandInterestGenerator::generateWithIdentity,
|
||||
&m_commandInterestGenerator, _1,
|
||||
boost::cref(identity)));
|
||||
cref(identity)));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -380,8 +380,7 @@ private:
|
||||
if (propertyIt != configSection.end())
|
||||
throw Error("Expect the end of checker!");
|
||||
|
||||
return make_shared<CustomizedChecker>(boost::cref(getSigType(sigType)),
|
||||
boost::cref(keyLocatorChecker));
|
||||
return make_shared<CustomizedChecker>(getSigType(sigType), cref(keyLocatorChecker));
|
||||
}
|
||||
|
||||
static shared_ptr<Checker>
|
||||
@@ -401,7 +400,7 @@ private:
|
||||
if (propertyIt != configSection.end())
|
||||
throw Error("Expect the end of checker!");
|
||||
|
||||
return make_shared<HierarchicalChecker>(boost::cref(getSigType(sigType)));
|
||||
return make_shared<HierarchicalChecker>(getSigType(sigType));
|
||||
}
|
||||
|
||||
static shared_ptr<Checker>
|
||||
|
||||
@@ -199,8 +199,8 @@ private:
|
||||
if (propertyIt != configSection.end())
|
||||
throw Error("Expect the end of filter!");
|
||||
|
||||
return make_shared<RelationNameFilter>(boost::cref(name),
|
||||
boost::cref(relation));
|
||||
return make_shared<RelationNameFilter>(cref(name),
|
||||
cref(relation));
|
||||
}
|
||||
else if (boost::iequals(propertyIt->first, "regex"))
|
||||
{
|
||||
|
||||
@@ -265,8 +265,8 @@ KeyChain::exportIdentity(const Name& identity, const std::string& passwordStr)
|
||||
m_pib->addCertificateAsIdentityDefault(*cert);
|
||||
}
|
||||
|
||||
shared_ptr<SecuredBag> secureBag = make_shared<SecuredBag>(boost::cref(*cert),
|
||||
boost::cref(pkcs5));
|
||||
// make_shared on OSX 10.9 has some strange problem here
|
||||
shared_ptr<SecuredBag> secureBag(new SecuredBag(*cert, pkcs5));
|
||||
|
||||
return secureBag;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ SecPublicInfoMemory::addPublicKey(const Name& keyName, KeyType keyType, const Pu
|
||||
|
||||
addIdentity(identityName);
|
||||
|
||||
m_keyStore[keyName.toUri()] = make_shared<KeyRecord>(keyType, boost::cref(publicKey));
|
||||
m_keyStore[keyName.toUri()] = make_shared<KeyRecord>(keyType, cref(publicKey));
|
||||
}
|
||||
|
||||
shared_ptr<PublicKey>
|
||||
|
||||
@@ -33,7 +33,7 @@ ValidatorConfig::ValidatorConfig(Face& face,
|
||||
, m_certificateCache(certificateCache)
|
||||
{
|
||||
if (!static_cast<bool>(m_certificateCache))
|
||||
m_certificateCache = make_shared<CertificateCacheTtl>(boost::ref(m_face.getIoService()));
|
||||
m_certificateCache = make_shared<CertificateCacheTtl>(ref(m_face.getIoService()));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -209,7 +209,7 @@ ValidatorConfig::checkSignature(const Packet& packet,
|
||||
Interest certInterest(keyLocatorName);
|
||||
|
||||
shared_ptr<ValidationRequest> nextStep =
|
||||
make_shared<ValidationRequest>(boost::cref(certInterest),
|
||||
make_shared<ValidationRequest>(cref(certInterest),
|
||||
onCertValidated,
|
||||
onCertValidationFailed,
|
||||
1, nSteps + 1);
|
||||
@@ -229,7 +229,7 @@ ValidatorConfig::onCertValidated(const shared_ptr<const Data>& signCertificate,
|
||||
const OnFailed& onValidationFailed)
|
||||
{
|
||||
shared_ptr<IdentityCertificate> certificate =
|
||||
make_shared<IdentityCertificate>(boost::cref(*signCertificate));
|
||||
make_shared<IdentityCertificate>(cref(*signCertificate));
|
||||
|
||||
if (!certificate->isTooLate() && !certificate->isTooEarly())
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ ValidatorRegex::ValidatorRegex(Face& face,
|
||||
, m_certificateCache(certificateCache)
|
||||
{
|
||||
if (!static_cast<bool>(m_certificateCache))
|
||||
m_certificateCache = make_shared<CertificateCacheTtl>(boost::ref(m_face.getIoService()));
|
||||
m_certificateCache = make_shared<CertificateCacheTtl>(ref(m_face.getIoService()));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -46,7 +46,7 @@ ValidatorRegex::onCertificateValidated(const shared_ptr<const Data>& signCertifi
|
||||
const OnDataValidationFailed& onValidationFailed)
|
||||
{
|
||||
shared_ptr<IdentityCertificate> certificate =
|
||||
make_shared<IdentityCertificate>(boost::cref(*signCertificate));
|
||||
make_shared<IdentityCertificate>(cref(*signCertificate));
|
||||
|
||||
if (!certificate->isTooLate() && !certificate->isTooEarly())
|
||||
{
|
||||
@@ -137,7 +137,7 @@ ValidatorRegex::checkPolicy(const Data& data,
|
||||
|
||||
Interest interest(sig.getKeyLocator().getName());
|
||||
shared_ptr<ValidationRequest> nextStep =
|
||||
make_shared<ValidationRequest>(boost::cref(interest),
|
||||
make_shared<ValidationRequest>(cref(interest),
|
||||
onKeyValidated,
|
||||
onKeyValidationFailed,
|
||||
3,
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
buffer.push_back(boost::asio::buffer(i->first.wire(), i->first.size()));
|
||||
buffer.push_back(boost::asio::buffer(i->second.wire(), i->second.size()));
|
||||
m_socket.async_send(buffer,
|
||||
bind(&impl::handle_async_send, this, _1, i->first, i->second));
|
||||
bind(&impl::handle_async_send2, this, _1, i->first, i->second));
|
||||
}
|
||||
|
||||
m_sendQueue.clear();
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
buffers.push_back(boost::asio::buffer(payload.wire(), payload.size()));
|
||||
|
||||
m_socket.async_send(buffers,
|
||||
bind(&impl::handle_async_send, this, _1, header, payload));
|
||||
bind(&impl::handle_async_send2, this, _1, header, payload));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,8 +253,8 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
handle_async_send(const boost::system::error_code& error,
|
||||
const Block& header, const Block& payload)
|
||||
handle_async_send2(const boost::system::error_code& error,
|
||||
const Block& header, const Block& payload)
|
||||
{
|
||||
// pass (needed to keep data blocks alive during the send)
|
||||
}
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
|
||||
// typename boost::asio::ip::basic_resolver< protocol > resolver;
|
||||
shared_ptr<typename protocol::resolver> resolver =
|
||||
make_shared<typename protocol::resolver>(boost::ref(this->m_socket.get_io_service()));
|
||||
make_shared<typename protocol::resolver>(ref(this->m_socket.get_io_service()));
|
||||
|
||||
resolver->async_resolve(query, bind(&impl::resolveHandler, this, _1, _2, resolver));
|
||||
}
|
||||
|
||||
@@ -34,8 +34,7 @@ TcpTransport::connect(boost::asio::io_service& ioService,
|
||||
if (!static_cast<bool>(m_impl)) {
|
||||
Transport::connect(ioService, receiveCallback);
|
||||
|
||||
m_impl = make_shared<Impl> (boost::ref(*this),
|
||||
boost::ref(ioService));
|
||||
m_impl = make_shared<Impl>(ref(*this), ref(ioService));
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::resolver::query query(m_host, m_port);
|
||||
|
||||
@@ -77,8 +77,7 @@ UnixTransport::connect(boost::asio::io_service& ioService,
|
||||
if (!static_cast<bool>(m_impl)) {
|
||||
Transport::connect(ioService, receiveCallback);
|
||||
|
||||
m_impl = make_shared<Impl> (boost::ref(*this),
|
||||
boost::ref(ioService));
|
||||
m_impl = make_shared<Impl>(ref(*this), ref(ioService));
|
||||
}
|
||||
|
||||
m_impl->connect(boost::asio::local::stream_protocol::endpoint(m_unixSocket));
|
||||
|
||||
@@ -97,7 +97,7 @@ RegexPatternListMatcher::extractPattern(int index, int* next)
|
||||
shared_ptr<RegexMatcher> matcher =
|
||||
make_shared<RegexBackrefMatcher>(m_expr.substr(start, end - start), m_backrefManager);
|
||||
m_backrefManager->pushRef(matcher);
|
||||
boost::dynamic_pointer_cast<RegexBackrefMatcher>(matcher)->lateCompile();
|
||||
dynamic_pointer_cast<RegexBackrefMatcher>(matcher)->lateCompile();
|
||||
|
||||
m_matcherList.push_back(matcher);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ RegexRepeatMatcher::compile()
|
||||
if ('(' == m_expr[0]){
|
||||
matcher = make_shared<RegexBackrefMatcher>(m_expr.substr(0, m_indicator), m_backrefManager);
|
||||
m_backrefManager->pushRef(matcher);
|
||||
boost::dynamic_pointer_cast<RegexBackrefMatcher>(matcher)->lateCompile();
|
||||
dynamic_pointer_cast<RegexBackrefMatcher>(matcher)->lateCompile();
|
||||
}
|
||||
else{
|
||||
matcher = make_shared<RegexComponentSetMatcher>(m_expr.substr(0, m_indicator),
|
||||
|
||||
@@ -47,13 +47,13 @@ RegexTopMatcher::compile()
|
||||
expr = expr.substr(0, expr.size()-1);
|
||||
|
||||
if ('^' != expr[0])
|
||||
m_secondaryMatcher = make_shared<RegexPatternListMatcher>(boost::cref("<.*>*" + expr),
|
||||
boost::cref(m_secondaryBackRefManager));
|
||||
m_secondaryMatcher = make_shared<RegexPatternListMatcher>("<.*>*" + expr,
|
||||
cref(m_secondaryBackRefManager));
|
||||
else
|
||||
expr = expr.substr(1, expr.size()-1);
|
||||
|
||||
m_primaryMatcher = make_shared<RegexPatternListMatcher>(boost::cref(expr),
|
||||
boost::cref(m_primaryBackRefManager));
|
||||
m_primaryMatcher = make_shared<RegexPatternListMatcher>(func_lib::cref(expr),
|
||||
func_lib::cref(m_primaryBackRefManager));
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -199,7 +199,8 @@ RegexTopMatcher::fromName(const Name& name, bool hasAnchor)
|
||||
if (hasAnchor)
|
||||
regexStr.append("$");
|
||||
|
||||
return make_shared<RegexTopMatcher>(boost::cref(regexStr));
|
||||
// OSX 10.9 has problems with just cref
|
||||
return make_shared<RegexTopMatcher>(func_lib::cref(regexStr));
|
||||
}
|
||||
|
||||
std::string
|
||||
|
||||
@@ -62,7 +62,8 @@ Scheduler::EventInfo::EventInfo(const time::nanoseconds& after,
|
||||
{
|
||||
}
|
||||
|
||||
Scheduler::EventInfo::EventInfo(const time::steady_clock::TimePoint& when, const EventInfo& previousEvent)
|
||||
Scheduler::EventInfo::EventInfo(const time::steady_clock::TimePoint& when,
|
||||
const EventInfo& previousEvent)
|
||||
: m_scheduledTime(when)
|
||||
, m_period(previousEvent.m_period)
|
||||
, m_event(previousEvent.m_event)
|
||||
@@ -101,7 +102,7 @@ Scheduler::schedulePeriodicEvent(const time::nanoseconds& after,
|
||||
const Event& event)
|
||||
{
|
||||
EventQueue::iterator i = m_events.insert(EventInfo(after, period, event));
|
||||
i->m_eventId = make_shared<EventIdImpl>(boost::cref(i));
|
||||
i->m_eventId = make_shared<EventIdImpl>(func_lib::cref(i));
|
||||
|
||||
if (!m_isEventExecuting)
|
||||
{
|
||||
|
||||
@@ -91,22 +91,23 @@ struct FacesFixture
|
||||
uint32_t regFailedCount;
|
||||
};
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE (Unix, FacesFixture)
|
||||
BOOST_FIXTURE_TEST_CASE(Unix, FacesFixture)
|
||||
{
|
||||
Face face;
|
||||
|
||||
face.expressInterest(Interest("/%C1.M.S.localhost/%C1.M.SRV/ndnd/KEY", time::milliseconds(1000)),
|
||||
ptr_lib::bind(&FacesFixture::onData, this),
|
||||
ptr_lib::bind(&FacesFixture::onTimeout, this));
|
||||
face.expressInterest(Interest("/", time::milliseconds(1000)),
|
||||
bind(&FacesFixture::onData, this),
|
||||
bind(&FacesFixture::onTimeout, this));
|
||||
|
||||
BOOST_REQUIRE_NO_THROW(face.processEvents());
|
||||
|
||||
BOOST_CHECK_EQUAL(dataCount, 1);
|
||||
BOOST_CHECK_EQUAL(timeoutCount, 0);
|
||||
|
||||
face.expressInterest(Interest("/localhost/non-existing/data/should/not/exist/anywhere", time::milliseconds(50)),
|
||||
ptr_lib::bind(&FacesFixture::onData, this),
|
||||
ptr_lib::bind(&FacesFixture::onTimeout, this));
|
||||
face.expressInterest(Interest("/localhost/non-existing/data/should/not/exist/anywhere",
|
||||
time::milliseconds(50)),
|
||||
bind(&FacesFixture::onData, this),
|
||||
bind(&FacesFixture::onTimeout, this));
|
||||
|
||||
BOOST_REQUIRE_NO_THROW(face.processEvents());
|
||||
|
||||
@@ -114,11 +115,11 @@ BOOST_FIXTURE_TEST_CASE (Unix, FacesFixture)
|
||||
BOOST_CHECK_EQUAL(timeoutCount, 1);
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE (Tcp, FacesFixture)
|
||||
BOOST_FIXTURE_TEST_CASE(Tcp, FacesFixture)
|
||||
{
|
||||
Face face("localhost");
|
||||
|
||||
face.expressInterest(Interest("/%C1.M.S.localhost/%C1.M.SRV/ndnd/KEY", time::milliseconds(1000)),
|
||||
face.expressInterest(Interest("/", time::milliseconds(1000)),
|
||||
bind(&FacesFixture::onData, this),
|
||||
bind(&FacesFixture::onTimeout, this));
|
||||
|
||||
@@ -127,7 +128,8 @@ BOOST_FIXTURE_TEST_CASE (Tcp, FacesFixture)
|
||||
BOOST_CHECK_EQUAL(dataCount, 1);
|
||||
BOOST_CHECK_EQUAL(timeoutCount, 0);
|
||||
|
||||
face.expressInterest(Interest("/localhost/non-existing/data/should/not/exist/anywhere", time::milliseconds(50)),
|
||||
face.expressInterest(Interest("/localhost/non-existing/data/should/not/exist/anywhere",
|
||||
time::milliseconds(50)),
|
||||
bind(&FacesFixture::onData, this),
|
||||
bind(&FacesFixture::onTimeout, this));
|
||||
|
||||
@@ -138,21 +140,21 @@ BOOST_FIXTURE_TEST_CASE (Tcp, FacesFixture)
|
||||
}
|
||||
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE (SetFilter, FacesFixture)
|
||||
BOOST_FIXTURE_TEST_CASE(SetFilter, FacesFixture)
|
||||
{
|
||||
Face face;
|
||||
Face face2(face.ioService());
|
||||
Scheduler scheduler(*face.ioService());
|
||||
scheduler.scheduleEvent(time::milliseconds(300),
|
||||
bind(&FacesFixture::terminate, this, func_lib::ref(face)));
|
||||
bind(&FacesFixture::terminate, this, ref(face)));
|
||||
|
||||
regPrefixId = face.setInterestFilter("/Hello/World",
|
||||
bind(&FacesFixture::onInterest, this, func_lib::ref(face)),
|
||||
bind(&FacesFixture::onInterest, this, ref(face)),
|
||||
bind(&FacesFixture::onRegFailed, this));
|
||||
|
||||
scheduler.scheduleEvent(time::milliseconds(200),
|
||||
bind(&FacesFixture::expressInterest, this,
|
||||
func_lib::ref(face2), Name("/Hello/World/!")));
|
||||
ref(face2), Name("/Hello/World/!")));
|
||||
|
||||
BOOST_REQUIRE_NO_THROW(face.processEvents());
|
||||
|
||||
@@ -162,26 +164,26 @@ BOOST_FIXTURE_TEST_CASE (SetFilter, FacesFixture)
|
||||
BOOST_CHECK_EQUAL(dataCount, 0);
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE (SetTwoFilters, FacesFixture)
|
||||
BOOST_FIXTURE_TEST_CASE(SetTwoFilters, FacesFixture)
|
||||
{
|
||||
Face face;
|
||||
Face face2(face.ioService());
|
||||
Scheduler scheduler(*face.ioService());
|
||||
scheduler.scheduleEvent(time::seconds(1),
|
||||
bind(&FacesFixture::terminate, this, func_lib::ref(face)));
|
||||
bind(&FacesFixture::terminate, this, ref(face)));
|
||||
|
||||
regPrefixId = face.setInterestFilter("/Hello/World",
|
||||
bind(&FacesFixture::onInterest, this, func_lib::ref(face)),
|
||||
bind(&FacesFixture::onInterest, this, ref(face)),
|
||||
bind(&FacesFixture::onRegFailed, this));
|
||||
|
||||
regPrefixId2 = face.setInterestFilter("/Los/Angeles/Lakers",
|
||||
bind(&FacesFixture::onInterest2, this, func_lib::ref(face)),
|
||||
bind(&FacesFixture::onInterest2, this, ref(face)),
|
||||
bind(&FacesFixture::onRegFailed, this));
|
||||
|
||||
|
||||
scheduler.scheduleEvent(time::milliseconds(200),
|
||||
bind(&FacesFixture::expressInterest, this,
|
||||
func_lib::ref(face2), Name("/Hello/World/!")));
|
||||
ref(face2), Name("/Hello/World/!")));
|
||||
|
||||
BOOST_REQUIRE_NO_THROW(face.processEvents());
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE (Ttl)
|
||||
{
|
||||
boost::asio::io_service io;
|
||||
shared_ptr<CertificateCacheTtl> cache =
|
||||
make_shared<CertificateCacheTtl>(boost::ref(io), time::seconds(1));
|
||||
make_shared<CertificateCacheTtl>(ref(io), time::seconds(1));
|
||||
Scheduler scheduler(io);
|
||||
|
||||
shared_ptr<IdentityCertificate> cert1 = make_shared<IdentityCertificate>();
|
||||
|
||||
@@ -262,7 +262,7 @@ BOOST_AUTO_TEST_CASE(BackRefMatcher)
|
||||
|
||||
shared_ptr<RegexBackrefManager> backRef = make_shared<RegexBackrefManager>();
|
||||
shared_ptr<RegexBackrefMatcher> cm = make_shared<RegexBackrefMatcher>("(<a><b>)", backRef);
|
||||
backRef->pushRef(boost::static_pointer_cast<RegexMatcher>(cm));
|
||||
backRef->pushRef(static_pointer_cast<RegexMatcher>(cm));
|
||||
cm->lateCompile();
|
||||
bool res = cm->match(Name("/a/b/c"), 0, 2);
|
||||
BOOST_CHECK_EQUAL(res, true);
|
||||
|
||||
Reference in new issue
Block a user