Implementing content store using Boost.MultiIndex container
Adding .SetGroupName("Ccnx") call to Ccnx-related objects (probably
missed some). This call is advisory, but it is nice to give users
information about Ccnx-related objects (this information is accessible
via --PrintGroup=Ccnx command line argument)
diff --git a/model/name-components.h b/model/name-components.h
index 0ea4821..95d2347 100644
--- a/model/name-components.h
+++ b/model/name-components.h
@@ -24,6 +24,7 @@
#include "ns3/simple-ref-count.h"
#include <string>
+#include <algorithm>
#include <list>
namespace ns3 {
@@ -58,6 +59,12 @@
inline size_t
size () const;
+
+ inline bool
+ operator== (const Components &prefix) const;
+
+ inline bool
+ operator< (const Components &prefix) const;
private:
std::list<std::string> m_prefix;
@@ -79,8 +86,20 @@
{
(*this) (s);
}
-
-
+
+bool
+Components::operator== (const Components &prefix) const
+{
+ return std::equal (m_prefix.begin (), m_prefix.end (), prefix.m_prefix.begin ());
+}
+
+bool
+Components::operator< (const Components &prefix) const
+{
+ return std::lexicographical_compare (m_prefix.begin (), m_prefix.end (),
+ prefix.m_prefix.begin (), prefix.m_prefix.end ());
+}
+
} // Namespace Name
} // namespace ns3