Checkpoint
diff --git a/model/sync-ns3-name-info.cc b/model/sync-ns3-name-info.cc
index 459486f..dc3b561 100644
--- a/model/sync-ns3-name-info.cc
+++ b/model/sync-ns3-name-info.cc
@@ -23,6 +23,7 @@
#include "sync-ns3-name-info.h"
#include "ns3/ccnx-name-components.h"
+#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <utility>
@@ -31,6 +32,7 @@
namespace Sync {
+
NameInfoConstPtr
Ns3NameInfo::FindOrCreate (ns3::Ptr<const ns3::CcnxNameComponents> name)
{
@@ -47,7 +49,8 @@
: m_name (name)
{
m_id = m_ids ++; // set ID for a newly inserted element
- // m_digest << *name;
+ m_digest << *name;
+ m_digest.getHash (); // finalize digest
}
string
@@ -69,5 +72,20 @@
}
}
+Digest &
+operator << (Digest &digest, const ns3::CcnxNameComponents &name)
+{
+ BOOST_FOREACH (const std::string &component, name.GetComponents ())
+ {
+ Digest subhash;
+ subhash << component;
+ subhash.getHash (); // finalize hash
+
+ digest << subhash;
+ }
+
+ return digest;
+}
+
} // Sync