diff --git a/core/resolver.hpp b/core/resolver.hpp index d4dc31c9..d1446457 100644 --- a/core/resolver.hpp +++ b/core/resolver.hpp @@ -1,11 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014 Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -20,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see . - **/ + */ #ifndef NFD_CORE_RESOLVER_H #define NFD_CORE_RESOLVER_H @@ -199,7 +200,7 @@ private: private: resolver m_resolver; - EventId m_resolveTimeout; + scheduler::EventId m_resolveTimeout; nfd::resolver::AddressSelector m_addressSelector; SuccessCallback m_onSuccess; diff --git a/core/scheduler.hpp b/core/scheduler.hpp index a4b43c11..b846c64d 100644 --- a/core/scheduler.hpp +++ b/core/scheduler.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -94,8 +94,6 @@ private: } // namespace scheduler -using scheduler::EventId; - } // namespace nfd #endif // NFD_CORE_SCHEDULER_HPP diff --git a/daemon/face/ethernet-face.hpp b/daemon/face/ethernet-face.hpp index ce72a625..7a3d881c 100644 --- a/daemon/face/ethernet-face.hpp +++ b/daemon/face/ethernet-face.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -145,7 +145,7 @@ private: struct Reassembler { unique_ptr pms; - EventId expireEvent; + scheduler::EventId expireEvent; }; unique_ptr m_pcap; diff --git a/daemon/face/ndnlp-partial-message-store.hpp b/daemon/face/ndnlp-partial-message-store.hpp index 1aed1e02..41431076 100644 --- a/daemon/face/ndnlp-partial-message-store.hpp +++ b/daemon/face/ndnlp-partial-message-store.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -56,7 +56,7 @@ public: reassemble(); public: - EventId m_expiry; + scheduler::EventId m_expiry; private: size_t m_fragCount; diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp index 01eb07a2..69a5241b 100644 --- a/daemon/face/tcp-channel.cpp +++ b/daemon/face/tcp-channel.cpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -83,9 +83,8 @@ TcpChannel::connect(const tcp::Endpoint& remoteEndpoint, shared_ptr clientSocket = make_shared(ref(getGlobalIoService())); - EventId connectTimeoutEvent = scheduler::schedule(timeout, - bind(&TcpChannel::handleFailedConnect, this, - clientSocket, onConnectFailed)); + scheduler::EventId connectTimeoutEvent = scheduler::schedule(timeout, + bind(&TcpChannel::handleFailedConnect, this, clientSocket, onConnectFailed)); clientSocket->async_connect(remoteEndpoint, bind(&TcpChannel::handleSuccessfulConnect, this, _1, @@ -106,9 +105,8 @@ TcpChannel::connect(const std::string& remoteHost, const std::string& remotePort shared_ptr resolver = make_shared(ref(getGlobalIoService())); - EventId connectTimeoutEvent = scheduler::schedule(timeout, - bind(&TcpChannel::handleFailedConnect, this, - clientSocket, onConnectFailed)); + scheduler::EventId connectTimeoutEvent = scheduler::schedule(timeout, + bind(&TcpChannel::handleFailedConnect, this, clientSocket, onConnectFailed)); resolver->async_resolve(query, bind(&TcpChannel::handleEndpointResolution, this, _1, _2, @@ -201,7 +199,7 @@ TcpChannel::handleSuccessfulAccept(const boost::system::error_code& error, void TcpChannel::handleSuccessfulConnect(const boost::system::error_code& error, const shared_ptr& socket, - const EventId& connectTimeoutEvent, + const scheduler::EventId& connectTimeoutEvent, const FaceCreatedCallback& onFaceCreated, const ConnectFailedCallback& onConnectFailed) { @@ -249,7 +247,7 @@ void TcpChannel::handleEndpointResolution(const boost::system::error_code& error, ip::tcp::resolver::iterator remoteEndpoint, const shared_ptr& socket, - const EventId& connectTimeoutEvent, + const scheduler::EventId& connectTimeoutEvent, const FaceCreatedCallback& onFaceCreated, const ConnectFailedCallback& onConnectFailed, const shared_ptr& resolver) diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp index f126a474..f83ca558 100644 --- a/daemon/face/tcp-channel.hpp +++ b/daemon/face/tcp-channel.hpp @@ -1,11 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014 Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -20,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see . - **/ + */ #ifndef NFD_DAEMON_FACE_TCP_CHANNEL_HPP #define NFD_DAEMON_FACE_TCP_CHANNEL_HPP @@ -124,7 +125,7 @@ private: void handleSuccessfulConnect(const boost::system::error_code& error, const shared_ptr& socket, - const EventId& connectTimeoutEvent, + const scheduler::EventId& connectTimeoutEvent, const FaceCreatedCallback& onFaceCreated, const ConnectFailedCallback& onConnectFailed); @@ -136,7 +137,7 @@ private: handleEndpointResolution(const boost::system::error_code& error, boost::asio::ip::tcp::resolver::iterator remoteEndpoint, const shared_ptr& socket, - const EventId& connectTimeoutEvent, + const scheduler::EventId& connectTimeoutEvent, const FaceCreatedCallback& onFaceCreated, const ConnectFailedCallback& onConnectFailed, const shared_ptr& resolver); diff --git a/daemon/face/udp-face.hpp b/daemon/face/udp-face.hpp index 49c374b2..b56b81df 100644 --- a/daemon/face/udp-face.hpp +++ b/daemon/face/udp-face.hpp @@ -1,11 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014 Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -20,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see . - **/ + */ #ifndef NFD_DAEMON_FACE_UDP_FACE_HPP #define NFD_DAEMON_FACE_UDP_FACE_HPP @@ -52,7 +53,7 @@ private: closeIfIdle(); private: - EventId m_closeIfIdleEvent; + scheduler::EventId m_closeIfIdleEvent; time::seconds m_idleTimeout; time::steady_clock::TimePoint m_lastIdleCheck; }; diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp index 8abdbac8..016dcace 100644 --- a/daemon/face/websocket-channel.cpp +++ b/daemon/face/websocket-channel.cpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -120,8 +120,8 @@ WebSocketChannel::handleOpen(websocketpp::connection_hdl hdl) m_channelFaces[hdl] = face; // Schedule PING message - EventId pingEvent = scheduler::schedule(m_pingInterval, - bind(&WebSocketChannel::sendPing, this, hdl)); + scheduler::EventId pingEvent = scheduler::schedule(m_pingInterval, + bind(&WebSocketChannel::sendPing, this, hdl)); face->setPingEventId(pingEvent); } @@ -145,8 +145,8 @@ WebSocketChannel::sendPing(websocketpp::connection_hdl hdl) NFD_LOG_TRACE("sendPing: to " << it->second->getRemoteUri()); // Schedule next PING message - EventId pingEvent = scheduler::schedule(m_pingInterval, - bind(&WebSocketChannel::sendPing, this, hdl)); + scheduler::EventId pingEvent = scheduler::schedule(m_pingInterval, + bind(&WebSocketChannel::sendPing, this, hdl)); it->second->setPingEventId(pingEvent); } } diff --git a/daemon/face/websocket-face.cpp b/daemon/face/websocket-face.cpp index ad344d17..26c1a253 100644 --- a/daemon/face/websocket-face.cpp +++ b/daemon/face/websocket-face.cpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. diff --git a/daemon/face/websocket-face.hpp b/daemon/face/websocket-face.hpp index 81a11115..56dd0151 100644 --- a/daemon/face/websocket-face.hpp +++ b/daemon/face/websocket-face.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014 Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see . - **/ + */ #ifndef NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP #define NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP @@ -65,7 +65,7 @@ public: close(); void - setPingEventId(EventId& id) + setPingEventId(scheduler::EventId& id) { m_pingEventId = id; } @@ -76,7 +76,7 @@ public: private: websocketpp::connection_hdl m_handle; websocket::Server& m_server; - EventId m_pingEventId; + scheduler::EventId m_pingEventId; bool m_closed; }; diff --git a/daemon/fw/ncc-strategy.hpp b/daemon/fw/ncc-strategy.hpp index 14a4696c..0c0991fc 100644 --- a/daemon/fw/ncc-strategy.hpp +++ b/daemon/fw/ncc-strategy.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -110,9 +110,9 @@ protected: public: /// timer that expires when best face does not respond within predicted time - EventId bestFaceTimeout; + scheduler::EventId bestFaceTimeout; /// timer for propagating to another face - EventId propagateTimer; + scheduler::EventId propagateTimer; /// maximum interval between forwarding to two nexthops except best and previous time::microseconds maxInterval; }; diff --git a/daemon/table/measurements-entry.hpp b/daemon/table/measurements-entry.hpp index 6593ee98..f2dd6274 100644 --- a/daemon/table/measurements-entry.hpp +++ b/daemon/table/measurements-entry.hpp @@ -1,11 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014 Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -20,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see . - **/ + */ #ifndef NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP #define NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP @@ -58,7 +59,7 @@ private: private: // lifetime time::steady_clock::TimePoint m_expiry; - EventId m_cleanup; + scheduler::EventId m_cleanup; shared_ptr m_nameTreeEntry; friend class nfd::NameTree; diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp index 8fcf4a78..6d59ce84 100644 --- a/daemon/table/pit-entry.hpp +++ b/daemon/table/pit-entry.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -164,8 +164,8 @@ public: // OutRecord hasUnexpiredOutRecords() const; public: - EventId m_unsatisfyTimer; - EventId m_stragglerTimer; + scheduler::EventId m_unsatisfyTimer; + scheduler::EventId m_stragglerTimer; private: shared_ptr m_interest; diff --git a/rib/face-entry.hpp b/rib/face-entry.hpp index c9eeb332..a6d468d0 100644 --- a/rib/face-entry.hpp +++ b/rib/face-entry.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -50,12 +50,12 @@ public: public: void - setExpirationEvent(const EventId eid) + setExpirationEvent(const scheduler::EventId eid) { m_expirationEvent = eid; } - const EventId& + const scheduler::EventId& getExpirationEvent() const { return m_expirationEvent; @@ -69,7 +69,7 @@ public: time::steady_clock::TimePoint expires; private: - EventId m_expirationEvent; + scheduler::EventId m_expirationEvent; }; inline bool diff --git a/rib/remote-registrator.hpp b/rib/remote-registrator.hpp index 0d9eea37..bdd6ca95 100644 --- a/rib/remote-registrator.hpp +++ b/rib/remote-registrator.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -222,7 +222,7 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE: * to Route Name. So it needs seperate sotrage instead * of storing within the RIB. */ - typedef std::unordered_map RegisteredList; + typedef std::unordered_map RegisteredList; typedef RegisteredList::iterator RegisteredEntryIt; typedef RegisteredList::value_type RegisteredEntry; RegisteredList m_regEntries; diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp index 7d0f5b31..809b301d 100644 --- a/rib/rib-manager.cpp +++ b/rib/rib-manager.cpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -298,10 +298,8 @@ RibManager::registerEntry(const shared_ptr& request, faceEntry.expires = time::steady_clock::now() + parameters.getExpirationPeriod(); // Schedule a new event, the old one will be cancelled during rib insertion. - EventId eventId; - eventId = scheduler::schedule(parameters.getExpirationPeriod(), - bind(&RibManager::expireEntry, - this, shared_ptr(), parameters)); + scheduler::EventId eventId = scheduler::schedule(parameters.getExpirationPeriod(), + bind(&RibManager::expireEntry, this, shared_ptr(), parameters)); NFD_LOG_TRACE("Scheduled unregistration at: " << faceEntry.expires << " with EventId: " << eventId); diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp index 181d210b..e3750b1d 100644 --- a/rib/rib-manager.hpp +++ b/rib/rib-manager.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -297,7 +297,7 @@ private: static const Name FACES_LIST_DATASET_PREFIX; static const time::seconds ACTIVE_FACE_FETCH_INTERVAL; - EventId m_activeFaceFetchEvent; + scheduler::EventId m_activeFaceFetchEvent; typedef std::set FaceIdSet; /** \brief contains FaceIds with one or more Routes in the RIB diff --git a/tests/core/scheduler.cpp b/tests/core/scheduler.cpp index 954c31e2..dcafac21 100644 --- a/tests/core/scheduler.cpp +++ b/tests/core/scheduler.cpp @@ -1,11 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014 Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -20,7 +21,7 @@ * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see . - **/ + */ #include "core/scheduler.hpp" @@ -29,6 +30,9 @@ namespace nfd { namespace tests { +using scheduler::EventId; +using scheduler::ScopedEventId; + BOOST_FIXTURE_TEST_SUITE(CoreScheduler, BaseFixture) class SchedulerFixture : protected BaseFixture @@ -115,7 +119,7 @@ BOOST_FIXTURE_TEST_CASE(ScopedEventIdDestruct, UnitTestTimeFixture) { int hit = 0; { - scheduler::ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; }); + ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; }); } // se goes out of scope this->advanceClocks(time::milliseconds(1), 15); BOOST_CHECK_EQUAL(hit, 0); @@ -124,7 +128,7 @@ BOOST_FIXTURE_TEST_CASE(ScopedEventIdDestruct, UnitTestTimeFixture) BOOST_FIXTURE_TEST_CASE(ScopedEventIdAssign, UnitTestTimeFixture) { int hit1 = 0, hit2 = 0; - scheduler::ScopedEventId se1 = scheduler::schedule(time::milliseconds(10), [&] { ++hit1; }); + ScopedEventId se1 = scheduler::schedule(time::milliseconds(10), [&] { ++hit1; }); se1 = scheduler::schedule(time::milliseconds(10), [&] { ++hit2; }); this->advanceClocks(time::milliseconds(1), 15); BOOST_CHECK_EQUAL(hit1, 0); @@ -135,7 +139,7 @@ BOOST_FIXTURE_TEST_CASE(ScopedEventIdRelease, UnitTestTimeFixture) { int hit = 0; { - scheduler::ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; }); + ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; }); se.release(); } // se goes out of scope this->advanceClocks(time::milliseconds(1), 15); @@ -147,8 +151,8 @@ BOOST_FIXTURE_TEST_CASE(ScopedEventIdMove, UnitTestTimeFixture) int hit = 0; unique_ptr se2; { - scheduler::ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; }); - se2.reset(new scheduler::ScopedEventId(std::move(se))); + ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; }); + se2.reset(new ScopedEventId(std::move(se))); } // se goes out of scope this->advanceClocks(time::milliseconds(1), 15); BOOST_CHECK_EQUAL(hit, 1); diff --git a/tests/limited-io.hpp b/tests/limited-io.hpp index ee358b01..3e4be61a 100644 --- a/tests/limited-io.hpp +++ b/tests/limited-io.hpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -102,7 +102,7 @@ private: UnitTestTimeFixture* m_uttf; bool m_isRunning; int m_nOpsRemaining; - EventId m_timeout; + scheduler::EventId m_timeout; StopReason m_reason; std::exception m_lastException; }; diff --git a/tests/rib/remote-registrator.cpp b/tests/rib/remote-registrator.cpp index c0ef5406..ed3181ae 100644 --- a/tests/rib/remote-registrator.cpp +++ b/tests/rib/remote-registrator.cpp @@ -1,12 +1,12 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /** - * Copyright (c) 2014, Regents of the University of California, - * Arizona Board of Regents, - * Colorado State University, - * University Pierre & Marie Curie, Sorbonne University, - * Washington University in St. Louis, - * Beijing Institute of Technology, - * The University of Memphis + * Copyright (c) 2014-2015, Regents of the University of California, + * Arizona Board of Regents, + * Colorado State University, + * University Pierre & Marie Curie, Sorbonne University, + * Washington University in St. Louis, + * Beijing Institute of Technology, + * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. @@ -348,7 +348,7 @@ BOOST_FIXTURE_TEST_CASE(UnregisterWithoutConnection, RemoteRegistratorFixture) Name indentity("/remote/register"); remoteRegistrator->m_regEntries.insert( - nfd::rib::RemoteRegistrator::RegisteredEntry(indentity, EventId())); + nfd::rib::RemoteRegistrator::RegisteredEntry(indentity, scheduler::EventId())); eraseEntryWithIdentity(indentity); @@ -386,7 +386,7 @@ BOOST_FIXTURE_TEST_CASE(UnregisterBasic, RemoteRegistratorFixture) insertEntryWithIdentity(identity); - EventId event; + scheduler::EventId event; remoteRegistrator->m_regEntries.insert( nfd::rib::RemoteRegistrator::RegisteredEntry(identity, event)); @@ -412,8 +412,8 @@ BOOST_FIXTURE_TEST_CASE(UnregisterAdvanced, RemoteRegistratorFixture) Name identityShort("/remote/register"); Name identityLong("/remote/register/long"); - EventId eventShort; - EventId eventLong; + scheduler::EventId eventShort; + scheduler::EventId eventLong; insertEntryWithIdentity(identityShort, name::Component("appA")); @@ -461,7 +461,7 @@ BOOST_FIXTURE_TEST_CASE(EraseFace, RemoteRegistratorFixture) insertEntryWithIdentity(identity, DEFAULT_APP_NAME, faceId); - EventId event; + scheduler::EventId event; remoteRegistrator->m_regEntries.insert( nfd::rib::RemoteRegistrator::RegisteredEntry(identity, event)); @@ -488,7 +488,7 @@ BOOST_FIXTURE_TEST_CASE(RebuildConnection, RemoteRegistratorFixture) insertEntryWithIdentity(identity); - EventId event; + scheduler::EventId event; remoteRegistrator->m_regEntries.insert( nfd::rib::RemoteRegistrator::RegisteredEntry(identity, event));