all: Replacing deprecated NameComponents class with Name
NameComponents is kept for backwards compatibility as typedef to Name
refs #29
diff --git a/model/fib/ndn-fib-entry.cc b/model/fib/ndn-fib-entry.cc
index 35b3a99..09b3ec6 100644
--- a/model/fib/ndn-fib-entry.cc
+++ b/model/fib/ndn-fib-entry.cc
@@ -20,7 +20,7 @@
#include "ndn-fib-entry.h"
-#include "ns3/ndn-name-components.h"
+#include "ns3/ndn-name.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
diff --git a/model/fib/ndn-fib-entry.h b/model/fib/ndn-fib-entry.h
index 93fa2aa..9cb3aec 100644
--- a/model/fib/ndn-fib-entry.h
+++ b/model/fib/ndn-fib-entry.h
@@ -24,7 +24,7 @@
#include "ns3/ptr.h"
#include "ns3/nstime.h"
#include "ns3/ndn-face.h"
-#include "ns3/ndn-name-components.h"
+#include "ns3/ndn-name.h"
#include "ns3/ndn-limits.h"
#include "ns3/traced-value.h"
@@ -40,7 +40,7 @@
namespace ns3 {
namespace ndn {
-class NameComponents;
+class Name;
namespace fib {
@@ -245,7 +245,7 @@
* \brief Constructor
* \param prefix smart pointer to the prefix for the FIB entry
*/
- Entry (const Ptr<const NameComponents> &prefix)
+ Entry (const Ptr<const Name> &prefix)
: m_prefix (prefix)
, m_needsProbing (false)
{
@@ -287,7 +287,7 @@
/**
* \brief Get prefix for the FIB entry
*/
- const NameComponents&
+ const Name&
GetPrefix () const { return *m_prefix; }
/**
@@ -311,7 +311,7 @@
friend std::ostream& operator<< (std::ostream& os, const Entry &entry);
public:
- Ptr<const NameComponents> m_prefix; ///< \brief Prefix of the FIB entry
+ Ptr<const Name> m_prefix; ///< \brief Prefix of the FIB entry
FaceMetricContainer::type m_faces; ///< \brief Indexed list of faces
bool m_needsProbing; ///< \brief flag indicating that probing should be performed
diff --git a/model/fib/ndn-fib-impl.cc b/model/fib/ndn-fib-impl.cc
index 3fc29a4..18ee6ac 100644
--- a/model/fib/ndn-fib-impl.cc
+++ b/model/fib/ndn-fib-impl.cc
@@ -85,13 +85,13 @@
Ptr<Entry>
-FibImpl::Add (const NameComponents &prefix, Ptr<Face> face, int32_t metric)
+FibImpl::Add (const Name &prefix, Ptr<Face> face, int32_t metric)
{
- return Add (Create<NameComponents> (prefix), face, metric);
+ return Add (Create<Name> (prefix), face, metric);
}
Ptr<Entry>
-FibImpl::Add (const Ptr<const NameComponents> &prefix, Ptr<Face> face, int32_t metric)
+FibImpl::Add (const Ptr<const Name> &prefix, Ptr<Face> face, int32_t metric)
{
NS_LOG_FUNCTION (this->GetObject<Node> ()->GetId () << boost::cref(*prefix) << boost::cref(*face) << metric);
@@ -123,7 +123,7 @@
}
void
-FibImpl::Remove (const Ptr<const NameComponents> &prefix)
+FibImpl::Remove (const Ptr<const Name> &prefix)
{
NS_LOG_FUNCTION (this->GetObject<Node> ()->GetId () << boost::cref(*prefix));
@@ -140,7 +140,7 @@
}
// void
-// FibImpl::Invalidate (const Ptr<const NameComponents> &prefix)
+// FibImpl::Invalidate (const Ptr<const Name> &prefix)
// {
// NS_LOG_FUNCTION (this->GetObject<Node> ()->GetId () << boost::cref(*prefix));
diff --git a/model/fib/ndn-fib-impl.h b/model/fib/ndn-fib-impl.h
index f47a7d1..9b45ba2 100644
--- a/model/fib/ndn-fib-impl.h
+++ b/model/fib/ndn-fib-impl.h
@@ -22,7 +22,7 @@
#define _NDN_FIB_IMPL_H_
#include "ns3/ndn-fib.h"
-#include "ns3/ndn-name-components.h"
+#include "ns3/ndn-name.h"
#include "../../utils/trie/trie-with-policy.h"
#include "../../utils/trie/counting-policy.h"
@@ -35,12 +35,12 @@
{
public:
typedef ndnSIM::trie_with_policy<
- NameComponents,
+ Name,
ndnSIM::smart_pointer_payload_traits<EntryImpl>,
ndnSIM::counting_policy_traits
> trie;
- EntryImpl (const Ptr<const NameComponents> &prefix)
+ EntryImpl (const Ptr<const Name> &prefix)
: Entry (prefix)
, item_ (0)
{
@@ -64,12 +64,12 @@
* \brief Class implementing FIB functionality
*/
class FibImpl : public Fib,
- protected ndnSIM::trie_with_policy< NameComponents,
+ protected ndnSIM::trie_with_policy< Name,
ndnSIM::smart_pointer_payload_traits< EntryImpl >,
ndnSIM::counting_policy_traits >
{
public:
- typedef ndnSIM::trie_with_policy< NameComponents,
+ typedef ndnSIM::trie_with_policy< Name,
ndnSIM::smart_pointer_payload_traits<EntryImpl>,
ndnSIM::counting_policy_traits > super;
@@ -89,13 +89,13 @@
LongestPrefixMatch (const InterestHeader &interest);
virtual Ptr<Entry>
- Add (const NameComponents &prefix, Ptr<Face> face, int32_t metric);
+ Add (const Name &prefix, Ptr<Face> face, int32_t metric);
virtual Ptr<Entry>
- Add (const Ptr<const NameComponents> &prefix, Ptr<Face> face, int32_t metric);
+ Add (const Ptr<const Name> &prefix, Ptr<Face> face, int32_t metric);
virtual void
- Remove (const Ptr<const NameComponents> &prefix);
+ Remove (const Ptr<const Name> &prefix);
virtual void
InvalidateAll ();
diff --git a/model/fib/ndn-fib.h b/model/fib/ndn-fib.h
index 951f2cb..141a402 100644
--- a/model/fib/ndn-fib.h
+++ b/model/fib/ndn-fib.h
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2011 University of California, Los Angeles
+ * Copyright (c) 2011-2013 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -60,7 +60,7 @@
* \todo Implement exclude filters
*
* \param interest Interest packet header
- * \returns If entry found a valid iterator will be returned, otherwise end ()
+ * \returns If entry found a valid iterator (Ptr<fib::Entry>) will be returned, otherwise End () (==0)
*/
virtual Ptr<fib::Entry>
LongestPrefixMatch (const InterestHeader &interest) = 0;
@@ -77,7 +77,7 @@
* @param metric Routing metric
*/
virtual Ptr<fib::Entry>
- Add (const NameComponents &prefix, Ptr<Face> face, int32_t metric) = 0;
+ Add (const Name &prefix, Ptr<Face> face, int32_t metric) = 0;
/**
* \brief Add or update FIB entry using smart pointer to prefix
@@ -91,7 +91,7 @@
* @param metric Routing metric
*/
virtual Ptr<fib::Entry>
- Add (const Ptr<const NameComponents> &prefix, Ptr<Face> face, int32_t metric) = 0;
+ Add (const Ptr<const Name> &prefix, Ptr<Face> face, int32_t metric) = 0;
/**
* @brief Remove FIB entry
@@ -102,7 +102,7 @@
* @param name Smart pointer to prefix
*/
virtual void
- Remove (const Ptr<const NameComponents> &prefix) = 0;
+ Remove (const Ptr<const Name> &prefix) = 0;
// /**
// * @brief Invalidate FIB entry ("Safe" version of Remove)
@@ -111,7 +111,7 @@
// * @param name Smart pointer to prefix
// */
// virtual void
- // Invalidate (const Ptr<const NameComponents> &prefix) = 0;
+ // Invalidate (const Ptr<const Name> &prefix) = 0;
/**
* @brief Invalidate all FIB entries