Added preliminary code for registerPrefix.
diff --git a/ndn-cpp/face.hpp b/ndn-cpp/face.hpp
index 2b1a41a..0b7aa54 100644
--- a/ndn-cpp/face.hpp
+++ b/ndn-cpp/face.hpp
@@ -26,7 +26,7 @@
}
/**
- * Create a new Face for communication with an NDN hub at host:port using the default UdpTransport.
+ * Create a new Face for communication with an NDN hub at host:port using the default TcpTransport.
* @param host The host of the NDN hub.
* @param port The port of the NDN hub.
*/
@@ -36,7 +36,7 @@
}
/**
- * Create a new Face for communication with an NDN hub at host with the default port 9695 and using the default UdpTransport.
+ * Create a new Face for communication with an NDN hub at host with the default port 9695 and using the default TcpTransport.
* @param host The host of the NDN hub.
*/
Face(const char *host)
@@ -122,6 +122,29 @@
}
/**
+ * Register prefix with the connected NDN hub and call onInterest when a matching interest is received.
+ * @param prefix A reference to a Name for the prefix to register. This copies the Name.
+ * @param onInterest A function object to call when a matching interest is received. This copies the function object, so you may need to
+ * use func_lib::ref() as appropriate.
+ * @param flags The flags for finer control of which interests are forward to the application.
+ */
+ void registerPrefix(const Name &prefix, const OnInterest &onInterest, int flags)
+ {
+ node_.registerPrefix(prefix, onInterest, flags);
+ }
+
+ /**
+ * Register prefix with the connected NDN hub and call onInterest when a matching interest is received.
+ * @param prefix A reference to a Name for the prefix to register. This copies the Name.
+ * @param onInterest A function object to call when a matching interest is received. This copies the function object, so you may need to
+ * use func_lib::ref() as appropriate.
+ */
+ void registerPrefix(const Name &prefix, const OnInterest &onInterest)
+ {
+ node_.registerPrefix(prefix, onInterest);
+ }
+
+ /**
* Process any data to receive or call timeout callbacks.
* This is non-blocking and will return immediately if there is no data to receive.
* You should repeatedly call this from an event loop, with calls to sleep as needed so that the loop doesn't use 100% of the CPU.