summaryrefslogtreecommitdiff
path: root/p2pvr/p2/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/p2/config.h')
-rw-r--r--p2pvr/p2/config.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/p2pvr/p2/config.h b/p2pvr/p2/config.h
new file mode 100644
index 0000000..56d8b53
--- /dev/null
+++ b/p2pvr/p2/config.h
@@ -0,0 +1,31 @@
+#ifndef P2PVRP2_CONFIG_H
+#define P2PVRP2_CONFIG_H
+
+#include <options.h>
+#include <componentLoader.h>
+#include <Ice/Communicator.h>
+#include <Ice/ObjectAdapter.h>
+
+class Config : public ComponentLoader {
+ public:
+ static Ice::ObjectAdapterPtr Adapter();
+ static Ice::CommunicatorPtr Communicator();
+ template <typename Proxy>
+ static Proxy GetProxy(const std::string & interface)
+ {
+ return Proxy::checkedCast(ic->stringToProxy(interface + ":" + DaemonAddress));
+ }
+
+ INITOPTIONS;
+ void onConfigLoad();
+
+ static std::string DaemonAddress;
+ static std::string CommunicatorArgs;
+
+ private:
+ static Ice::CommunicatorPtr ic;
+ static Ice::ObjectAdapterPtr adapter;
+};
+
+#endif
+