face: Implementing nfd::Controller
This commit also adds an option for Node constructor to use
nfd::Controller instead of default ndnd::Controller to set interest
filter (register prefix).
Change-Id: If395756c1b98abe909cec0967c07d347affe5928
diff --git a/src/management/controller.hpp b/src/management/controller.hpp
new file mode 100644
index 0000000..f919489
--- /dev/null
+++ b/src/management/controller.hpp
@@ -0,0 +1,43 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_MANAGEMENT_CONTROLLER_HPP
+#define NDN_MANAGEMENT_CONTROLLER_HPP
+
+#include "../common.hpp"
+#include "../name.hpp"
+#include "../interest.hpp"
+#include "../data.hpp"
+
+namespace ndn {
+
+class Node;
+
+class Controller
+{
+public:
+ typedef function<void()> SuccessCallback;
+ typedef function<void(const std::string&)> FailCallback;
+
+ virtual
+ ~Controller()
+ {
+ }
+
+ virtual void
+ selfRegisterPrefix(const Name& prefixToRegister,
+ const SuccessCallback& onSuccess,
+ const FailCallback& onFail) = 0;
+
+ virtual void
+ selfDeregisterPrefix(const Name& prefixToRegister,
+ const SuccessCallback& onSuccess,
+ const FailCallback& onFail) = 0;
+};
+
+} // namespace ndn
+
+#endif // NDN_MANAGEMENT_CONTROLLER_HPP