Major update to rename NDN class to Face
diff --git a/ndn-cpp/transport/TcpTransport.cpp b/ndn-cpp/transport/TcpTransport.cpp
index 1f217f0..a6a6663 100644
--- a/ndn-cpp/transport/TcpTransport.cpp
+++ b/ndn-cpp/transport/TcpTransport.cpp
@@ -4,7 +4,7 @@
*/
#include <stdexcept>
-#include "../NDN.hpp"
+#include "../face.hpp"
#include "../c/util/ndn_realloc.h"
#include "TcpTransport.hpp"
@@ -12,20 +12,20 @@
namespace ndn {
-void TcpTransport::connect(NDN &ndn)
+void TcpTransport::connect(Face &face)
{
ndn_Error error;
- if (error = ndn_TcpTransport_connect(&transport_, (char *)ndn.getHost(), ndn.getPort()))
+ if (error = ndn_TcpTransport_connect(&transport_, (char *)face.getHost(), face.getPort()))
throw std::runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const unsigned int initialLength = 1000;
// Automatically cast ndn_ to (struct ndn_ElementListener *)
ndn_BinaryXmlElementReader_init
- (&elementReader_, &ndn, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
+ (&elementReader_, &face, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
// TODO: Properly indicate connected status.
- ndn_ = &ndn;
+ face_ = &face;
}
void TcpTransport::send(const unsigned char *data, unsigned int dataLength)
diff --git a/ndn-cpp/transport/TcpTransport.hpp b/ndn-cpp/transport/TcpTransport.hpp
index b3b8d30..88e61fb 100644
--- a/ndn-cpp/transport/TcpTransport.hpp
+++ b/ndn-cpp/transport/TcpTransport.hpp
@@ -17,14 +17,14 @@
TcpTransport()
{
ndn_TcpTransport_init(&transport_);
- ndn_ = 0;
+ face_ = 0;
}
/**
*
- * @param ndn Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
+ * @param face Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
*/
- virtual void connect(NDN &ndn);
+ virtual void connect(Face &face);
virtual void send(const unsigned char *data, unsigned int dataLength);
@@ -32,7 +32,7 @@
private:
struct ndn_TcpTransport transport_;
- NDN *ndn_;
+ Face *face_;
// TODO: This belongs in the socket listener.
ndn_BinaryXmlElementReader elementReader_;
};
diff --git a/ndn-cpp/transport/Transport.cpp b/ndn-cpp/transport/Transport.cpp
index 0fa97bc..e0aab03 100644
--- a/ndn-cpp/transport/Transport.cpp
+++ b/ndn-cpp/transport/Transport.cpp
@@ -10,7 +10,7 @@
namespace ndn {
-void Transport::connect(NDN &ndn)
+void Transport::connect(Face &face)
{
throw logic_error("unimplemented");
}
diff --git a/ndn-cpp/transport/Transport.hpp b/ndn-cpp/transport/Transport.hpp
index 4a55573..af1a2c0 100644
--- a/ndn-cpp/transport/Transport.hpp
+++ b/ndn-cpp/transport/Transport.hpp
@@ -10,14 +10,14 @@
namespace ndn {
-class NDN;
+class Face;
class Transport {
public:
/**
*
- * @param ndn Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
+ * @param face Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
*/
- virtual void connect(NDN &ndn);
+ virtual void connect(Face &face);
virtual void send(const unsigned char *data, unsigned int dataLength);
diff --git a/ndn-cpp/transport/UdpTransport.cpp b/ndn-cpp/transport/UdpTransport.cpp
index 6fd47e4..52b62a5 100644
--- a/ndn-cpp/transport/UdpTransport.cpp
+++ b/ndn-cpp/transport/UdpTransport.cpp
@@ -4,7 +4,7 @@
*/
#include <stdexcept>
-#include "../NDN.hpp"
+#include "../face.hpp"
#include "../c/util/ndn_realloc.h"
#include "UdpTransport.hpp"
@@ -12,20 +12,20 @@
namespace ndn {
-void UdpTransport::connect(NDN &ndn)
+void UdpTransport::connect(Face &face)
{
ndn_Error error;
- if (error = ndn_UdpTransport_connect(&transport_, (char *)ndn.getHost(), ndn.getPort()))
+ if (error = ndn_UdpTransport_connect(&transport_, (char *)face.getHost(), face.getPort()))
throw std::runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const unsigned int initialLength = 1000;
// Automatically cast ndn_ to (struct ndn_ElementListener *)
ndn_BinaryXmlElementReader_init
- (&elementReader_, &ndn, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
+ (&elementReader_, &face, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
// TODO: Properly indicate connected status.
- ndn_ = &ndn;
+ face_ = &face;
}
void UdpTransport::send(const unsigned char *data, unsigned int dataLength)
diff --git a/ndn-cpp/transport/UdpTransport.hpp b/ndn-cpp/transport/UdpTransport.hpp
index 460eedd..781effd 100644
--- a/ndn-cpp/transport/UdpTransport.hpp
+++ b/ndn-cpp/transport/UdpTransport.hpp
@@ -17,14 +17,14 @@
UdpTransport()
{
ndn_UdpTransport_init(&transport_);
- ndn_ = 0;
+ face_ = 0;
}
/**
*
- * @param ndn Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
+ * @param face Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
*/
- virtual void connect(NDN &ndn);
+ virtual void connect(Face &face);
virtual void send(const unsigned char *data, unsigned int dataLength);
@@ -32,7 +32,7 @@
private:
struct ndn_UdpTransport transport_;
- NDN *ndn_;
+ Face *face_;
// TODO: This belongs in the socket listener.
ndn_BinaryXmlElementReader elementReader_;
};