diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-01-11 20:43:42 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-01-31 16:13:19 +0000 |
commit | f387cd34ec00ca0a66201cfd44373ab2008a0da8 (patch) | |
tree | 3433b009d308ebed1c5ae6bd87df101996f9fd1d /mythfs/service/main.cpp | |
parent | Build most things by default (diff) | |
download | mythfs-f387cd34ec00ca0a66201cfd44373ab2008a0da8.tar.bz2 mythfs-f387cd34ec00ca0a66201cfd44373ab2008a0da8.tar.xz mythfs-f387cd34ec00ca0a66201cfd44373ab2008a0da8.zip |
WIP MythFS inodes
Diffstat (limited to 'mythfs/service/main.cpp')
-rw-r--r-- | mythfs/service/main.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/mythfs/service/main.cpp b/mythfs/service/main.cpp index 145cf71..6aafc7a 100644 --- a/mythfs/service/main.cpp +++ b/mythfs/service/main.cpp @@ -5,16 +5,18 @@ #include "recordingsVolume.h" #include "dbimpl.h" -class Api : public IceTray::Service { - public: - void addObjects(const std::string &, const Ice::CommunicatorPtr & ic, const Ice::StringSeq &, const Ice::ObjectAdapterPtr & adp) override - { - auto db = getConnectionPool(ic, "mysql", "mythconverg"); - adp->add(new MythFS::Service(), ic->stringToIdentity("service")); - adp->add(new MythFS::DBImpl(db), ic->stringToIdentity("db")); - adp->add(new MythFS::RecordingsVolume(), ic->stringToIdentity("recordings")); - } -}; +namespace MythFS { + class Api : public IceTray::Service { + public: + void addObjects(const std::string &, const Ice::CommunicatorPtr & ic, const Ice::StringSeq &, const Ice::ObjectAdapterPtr & adp) override + { + auto dbpool = getConnectionPool(ic, "mysql", "MythFS"); + adp->add(new MythFS::Service(), ic->stringToIdentity("Service")); + auto dbservice = DBPrx::uncheckedCast(adp->add(new DBImpl(dbpool), ic->stringToIdentity("DB"))); + adp->add(new RecordingsVolume(dbservice), ic->stringToIdentity("recordings")); + } + }; -NAMEDFACTORY("default", Api, IceTray::ServiceFactory); + NAMEDFACTORY("default", MythFS::Api, IceTray::ServiceFactory); +} |