summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 7ee7dfff3e7ad8b485ff17a64193fa4ac3dbf6fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "repoList.h"
#include <Ice/BuiltinSequences.h>
#include <Ice/Communicator.h>
#include <Ice/ObjectAdapter.h>
#include <factory.h>
#include <git2.h>
#include <icecube.h>
#include <icetrayService.h>
#include <memory>
#include <service.h>
#include <string>

namespace GitFS {
	class Main : public IceTray::Service {
	public:
		Main()
		{
			git_libgit2_init();
		}

		~Main() override
		{
			git_libgit2_shutdown();
		}

		Main(const Main &) = delete;
		Main(Main &&) = delete;

		Main & operator=(const Main &) = delete;
		Main & operator=(Main &&) = delete;

		void
		addObjects(const std::string &, const Ice::CommunicatorPtr & ic, const Ice::StringSeq &,
				const Ice::ObjectAdapterPtr & adp) override
		{
			IceTray::Cube::addObject<NetFS::Service, RepoList>(adp, "Service", ic->getProperties());
		}
	};

	NAMEDFACTORY("default", Main, IceTray::ServiceFactory);
}