mgmt: move management/nfd-* to mgmt/nfd/
refs #3760
Change-Id: Ib4bde3412b5c39b9f4f46113199cebe78704505e
diff --git a/src/management/nfd-rib-entry.hpp b/src/management/nfd-rib-entry.hpp
index ad5fe92..2673e6c 100644
--- a/src/management/nfd-rib-entry.hpp
+++ b/src/management/nfd-rib-entry.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,269 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_MANAGEMENT_NFD_RIB_ENTRY_HPP
-#define NDN_MANAGEMENT_NFD_RIB_ENTRY_HPP
-
-#include "nfd-rib-flags.hpp" // include this first, to ensure it compiles on its own.
-#include "../name.hpp"
-#include "../util/time.hpp"
-
-#include <list>
-
-namespace ndn {
-namespace nfd {
-
-/**
- * @ingroup management
- *
- * @brief Data abstraction for Route
- *
- * A route indicates the availability of content via a certain face and
- * provides meta-information about the face.
- *
- * Route := ROUTE-TYPE TLV-LENGTH
- * FaceId
- * Origin
- * Cost
- * Flags
- * ExpirationPeriod?
- *
- * @sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
+/** \file
+ * \deprecated Use mgmt/nfd/rib-entry.hpp
*/
-class Route : public RibFlagsTraits<Route>
-{
-public:
- class Error : public tlv::Error
- {
- public:
- explicit
- Error(const std::string& what) : tlv::Error(what)
- {
- }
- };
-
- Route();
-
- explicit
- Route(const Block& block);
-
- uint64_t
- getFaceId() const
- {
- return m_faceId;
- }
-
- Route&
- setFaceId(uint64_t faceId)
- {
- m_faceId = faceId;
- m_wire.reset();
- return *this;
- }
-
- uint64_t
- getOrigin() const
- {
- return m_origin;
- }
-
- /** @brief set Origin
- * @param origin a code defined in ndn::nfd::RouteOrigin
- */
- Route&
- setOrigin(uint64_t origin)
- {
- m_origin = origin;
- m_wire.reset();
- return *this;
- }
-
- uint64_t
- getCost() const
- {
- return m_cost;
- }
-
- Route&
- setCost(uint64_t cost)
- {
- m_cost = cost;
- m_wire.reset();
- return *this;
- }
-
- uint64_t
- getFlags() const
- {
- return m_flags;
- }
-
- /** @brief set route inheritance flags
- * @param flags a bitwise OR'ed code from ndn::nfd::RouteFlags
- */
- Route&
- setFlags(uint64_t flags)
- {
- m_flags = flags;
- m_wire.reset();
- return *this;
- }
-
- static const time::milliseconds INFINITE_EXPIRATION_PERIOD;
-
- const time::milliseconds&
- getExpirationPeriod() const
- {
- return m_expirationPeriod;
- }
-
- Route&
- setExpirationPeriod(const time::milliseconds& expirationPeriod)
- {
- m_expirationPeriod = expirationPeriod;
-
- m_hasInfiniteExpirationPeriod = m_expirationPeriod == INFINITE_EXPIRATION_PERIOD;
-
- m_wire.reset();
- return *this;
- }
-
- bool
- hasInfiniteExpirationPeriod() const
- {
- return m_hasInfiniteExpirationPeriod;
- }
-
- template<encoding::Tag TAG>
- size_t
- wireEncode(EncodingImpl<TAG>& block) const;
-
- const Block&
- wireEncode() const;
-
- void
- wireDecode(const Block& wire);
-
-private:
- uint64_t m_faceId;
- uint64_t m_origin;
- uint64_t m_cost;
- uint64_t m_flags;
- time::milliseconds m_expirationPeriod;
- bool m_hasInfiniteExpirationPeriod;
-
- mutable Block m_wire;
-};
-
-std::ostream&
-operator<<(std::ostream& os, const Route& route);
-
-/**
- * @ingroup management
- *
- * @brief Data abstraction for RIB entry
- *
- * A RIB entry contains one or more routes for the name prefix
- *
- * RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
- * Name
- * Route+
- *
- * @sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
- */
-class RibEntry
-{
-public:
- class Error : public tlv::Error
- {
- public:
- Error(const std::string& what) : tlv::Error(what)
- {
- }
- };
-
- typedef std::list<Route> RouteList;
- typedef RouteList::const_iterator iterator;
-
- RibEntry();
-
- explicit
- RibEntry(const Block& block);
-
- const Name&
- getName() const
- {
- return m_prefix;
- }
-
- RibEntry&
- setName(const Name& prefix)
- {
- m_prefix = prefix;
- m_wire.reset();
- return *this;
- }
-
- const std::list<Route>&
- getRoutes() const
- {
- return m_routes;
- }
-
- RibEntry&
- addRoute(const Route& route)
- {
- m_routes.push_back(route);
- m_wire.reset();
- return *this;
- }
-
- RibEntry&
- clearRoutes()
- {
- m_routes.clear();
- return *this;
- }
-
- template<encoding::Tag TAG>
- size_t
- wireEncode(EncodingImpl<TAG>& block) const;
-
- const Block&
- wireEncode() const;
-
- void
- wireDecode(const Block& wire);
-
- iterator
- begin() const;
-
- iterator
- end() const;
-
-private:
- Name m_prefix;
- RouteList m_routes;
-
- mutable Block m_wire;
-};
-
-inline RibEntry::iterator
-RibEntry::begin() const
-{
- return m_routes.begin();
-}
-
-inline RibEntry::iterator
-RibEntry::end() const
-{
- return m_routes.end();
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RibEntry& entry);
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_RIB_ENTRY_HPP
+#include "../mgmt/nfd/rib-entry.hpp"