diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-03-06 08:30:08 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-03-06 08:30:08 +0000 |
commit | afb5ebabf55c5c806e221ad15fca2fa0d5ef6d2b (patch) | |
tree | e63b671e8dd8e3813ed2fa76a82a5aa39c5c2667 /service/main.cpp | |
download | mirrorsearch-afb5ebabf55c5c806e221ad15fca2fa0d5ef6d2b.tar.bz2 mirrorsearch-afb5ebabf55c5c806e221ad15fca2fa0d5ef6d2b.tar.xz mirrorsearch-afb5ebabf55c5c806e221ad15fca2fa0d5ef6d2b.zip |
Initial commit, WIP
Diffstat (limited to 'service/main.cpp')
-rw-r--r-- | service/main.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/service/main.cpp b/service/main.cpp new file mode 100644 index 0000000..97bc89e --- /dev/null +++ b/service/main.cpp @@ -0,0 +1,18 @@ +#include <Ice/Communicator.h> +#include <Ice/ObjectAdapter.h> +#include <icetrayService.h> +#include "apiImpl.h" + +namespace MirrorSearch { + 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, "postgresql", "MirrorSearch"); + adp->add(new SearchImpl(dbpool), ic->stringToIdentity("Search")); + } + }; + + NAMEDFACTORY("default", MirrorSearch::Api, IceTray::ServiceFactory); +} + |