summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-09-28 01:38:35 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-09-28 01:38:35 +0100
commit22d80295755a371cba345751aea348b5c5aae806 (patch)
treed1ce826c9d0e11585402e14b5dfe6f22bb1536fc
parentSuport finding ComponentLoaders in AdHoc Plugins (diff)
downloadproject2-22d80295755a371cba345751aea348b5c5aae806.tar.bz2
project2-22d80295755a371cba345751aea348b5c5aae806.tar.xz
project2-22d80295755a371cba345751aea348b5c5aae806.zip
Use AdHoc plugins for daemons
-rw-r--r--project2/daemon/lib/daemon.cpp4
-rw-r--r--project2/daemon/lib/daemon.h4
-rw-r--r--project2/daemon/p2daemonAppEngine.cpp6
-rw-r--r--project2/ice/iceDaemon.cpp4
4 files changed, 9 insertions, 9 deletions
diff --git a/project2/daemon/lib/daemon.cpp b/project2/daemon/lib/daemon.cpp
index bde0f45..f4af1c8 100644
--- a/project2/daemon/lib/daemon.cpp
+++ b/project2/daemon/lib/daemon.cpp
@@ -1,5 +1,5 @@
#include "daemon.h"
-#include "instanceStore.impl.h"
+#include <factory.impl.h>
Daemon::Daemon()
{
@@ -19,5 +19,5 @@ Daemon::teardown() const
{
}
-INSTANTIATESTORE(std::string, DaemonLoader);
+INSTANTIATEFACTORY(Daemon, int &, char **);
diff --git a/project2/daemon/lib/daemon.h b/project2/daemon/lib/daemon.h
index d565e57..261d2f0 100644
--- a/project2/daemon/lib/daemon.h
+++ b/project2/daemon/lib/daemon.h
@@ -2,7 +2,7 @@
#define DAEMON_H
#include <glibmm/ustring.h>
-#include <genLoader.h>
+#include <factory.h>
#include <intrusivePtrBase.h>
class Daemon : public IntrusivePtrBase {
@@ -17,7 +17,7 @@ class Daemon : public IntrusivePtrBase {
};
typedef boost::intrusive_ptr<Daemon> DaemonPtr;
-typedef GenLoader<Daemon, std::string, int &, char **> DaemonLoader;
+typedef AdHoc::Factory<Daemon, int &, char **> DaemonFactory;
#endif
diff --git a/project2/daemon/p2daemonAppEngine.cpp b/project2/daemon/p2daemonAppEngine.cpp
index 42b4cda..6ed0472 100644
--- a/project2/daemon/p2daemonAppEngine.cpp
+++ b/project2/daemon/p2daemonAppEngine.cpp
@@ -53,8 +53,8 @@ END_OPTIONS(DaemonAppEngine);
DaemonAppEngine::DaemonAppEngine(int argc, char ** argv) :
main_loop(Glib::MainLoop::create()),
- daemonFactory(boost::bind(&DaemonLoader::create,
- boost::bind(DaemonLoader::getFor, boost::cref(daemonType)), argc, argv))
+ daemonFactory(boost::bind(&::DaemonFactory::create,
+ boost::bind(::DaemonFactory::get, boost::cref(daemonType)), argc, argv))
{
}
@@ -174,6 +174,6 @@ class DummyDaemon : public Daemon {
private:
mutable bool stop;
};
-DECLARE_GENERIC_LOADER("dummydaemon", DaemonLoader, DummyDaemon);
+NAMEDFACTORY("dummydaemon", DummyDaemon, DaemonFactory);
#endif
diff --git a/project2/ice/iceDaemon.cpp b/project2/ice/iceDaemon.cpp
index ccd64a0..15ae1b0 100644
--- a/project2/ice/iceDaemon.cpp
+++ b/project2/ice/iceDaemon.cpp
@@ -24,14 +24,14 @@ std::string IceDaemon::viewRoot;
std::string IceDaemon::taskRoot;
IceBase::Libs IceDaemon::libs;
-class IceDaemonLoader : public DaemonLoader::For<IceDaemon> {
+class IceDaemonFactory : public DaemonFactory::For<IceDaemon>, public ComponentLoader {
public:
void onConfigLoad() override {
IceBase::FinaliseLoad(IceDaemon::libs);
}
};
-DECLARE_CUSTOM_COMPONENT_LOADER("ice", IceDaemon, IceDaemonLoader, DaemonLoader);
+NAMEDPLUGIN("ice", IceDaemonFactory, DaemonFactory);
DECLARE_OPTIONS(IceDaemon, "ICE Daemon Options")
("ice.daemon.viewRoot", Options::value(&viewRoot, "views"),
"The folder in which to find view scripts")