Checkpoint towards Fetcher with forwarding hint support
diff --git a/ccnx/ccnx-name.cpp b/ccnx/ccnx-name.cpp
index a59cf8a..4573ed1 100644
--- a/ccnx/ccnx-name.cpp
+++ b/ccnx/ccnx-name.cpp
@@ -155,6 +155,14 @@
}
Name &
+Name::appendComp(const Name &comp)
+{
+ m_comps.insert (m_comps.end (),
+ comp.m_comps.begin (), comp.m_comps.end ());
+ return *this;
+}
+
+Name &
Name::appendComp(const Bytes &comp)
{
m_comps.push_back(comp);
@@ -169,16 +177,6 @@
}
Name &
-Name::appendComp(const Name &name)
-{
- for (vector<Bytes>::const_iterator i = name.m_comps.begin (); i != name.m_comps.end (); i++)
- {
- appendComp (*i);
- }
- return *this;
-}
-
-Name &
Name::appendComp (const void *buf, size_t size)
{
Bytes comp (reinterpret_cast<const unsigned char*> (buf), reinterpret_cast<const unsigned char*> (buf) + size);
@@ -190,7 +188,7 @@
{
Bytes comp;
comp.push_back (0);
-
+
while (number > 0)
{
comp.push_back (static_cast<unsigned char> (number & 0xFF));
diff --git a/ccnx/ccnx-name.h b/ccnx/ccnx-name.h
index ec55397..a07f854 100644
--- a/ccnx/ccnx-name.h
+++ b/ccnx/ccnx-name.h
@@ -80,15 +80,15 @@
operator CcnxCharbufPtr () const { return toCcnxCharbuf (); }
Name &
+ appendComp(const Name &comp);
+
+ Name &
appendComp(const Bytes &comp);
Name &
appendComp(const string &compStr);
Name &
- appendComp(const Name &name);
-
- Name &
appendComp(const void *buf, size_t size);
/**
diff --git a/ccnx/ccnx-tunnel.cpp b/ccnx/ccnx-tunnel.cpp
index 6bf117f..def125a 100644
--- a/ccnx/ccnx-tunnel.cpp
+++ b/ccnx/ccnx-tunnel.cpp
@@ -26,8 +26,8 @@
{
CcnxTunnel::CcnxTunnel()
- : CcnxWrapper()
- , m_localPrefix("/")
+ : CcnxWrapper()
+ , m_localPrefix("/")
{
refreshLocalPrefix();
}
diff --git a/ccnx/ccnx-tunnel.h b/ccnx/ccnx-tunnel.h
index ce56775..01dbf5e 100644
--- a/ccnx/ccnx-tunnel.h
+++ b/ccnx/ccnx-tunnel.h
@@ -22,10 +22,7 @@
#ifndef CCNX_TUNNEL_H
#define CCNX_TUNNEL_H
-#include "ccnx-common.h"
#include "ccnx-wrapper.h"
-#include "ccnx-name.h"
-#include "ccnx-selectors.h"
#define _OVERRIDE
#ifdef __GNUC__
diff --git a/ccnx/ccnx-wrapper.h b/ccnx/ccnx-wrapper.h
index 1127316..938b890 100644
--- a/ccnx/ccnx-wrapper.h
+++ b/ccnx/ccnx-wrapper.h
@@ -19,13 +19,6 @@
class CcnxWrapper
{
public:
- typedef boost::shared_mutex Lock;
- typedef boost::unique_lock<Lock> WriteLock;
- typedef boost::shared_lock<Lock> ReadLock;
-
- typedef boost::recursive_mutex RecLock;
- typedef boost::unique_lock<RecLock> UniqueRecLock;
-
typedef boost::function<void (const Name &)> InterestCallback;
CcnxWrapper();
@@ -69,6 +62,13 @@
/// @endcond
protected:
+ typedef boost::shared_mutex Lock;
+ typedef boost::unique_lock<Lock> WriteLock;
+ typedef boost::shared_lock<Lock> ReadLock;
+
+ typedef boost::recursive_mutex RecLock;
+ typedef boost::unique_lock<RecLock> UniqueRecLock;
+
ccn* m_handle;
RecLock m_mutex;
boost::thread m_thread;