summaryrefslogtreecommitdiff
path: root/icetray/dryice/dryice.h
blob: 998f76dee590a6802f41d877502a5fac82038f1e (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
#ifndef ICETRAY_TESTSETUP_H
#define ICETRAY_TESTSETUP_H

#include <Ice/Communicator.h>
#include <IceBox/IceBox.h>
#include <visibility.h>
#include "icetrayService.h"

namespace IceTray {
	class DLL_PUBLIC DryIce {
		public:
			DryIce(const Ice::StringSeq & = Ice::StringSeq());
			DryIce(const DryIce &) = delete;
			virtual ~DryIce();

			void operator=(const DryIce &) = delete;
			std::string getEndpoint() const;

		protected:
			friend class DryIceClient;
			static DryIce * currentDryIce;

			Ice::CommunicatorPtr ic;
			IceTray::ServicePtr s;
	};

	class DLL_PUBLIC DryIceClient {
		public:
			DryIceClient();
			virtual ~DryIceClient();

			template<typename Prx>
			Prx getProxy(const std::string & objectName) const
			{
				return Prx::checkedCast(DryIce::currentDryIce->ic->stringToProxy(objectName));
			}
	};
}

#endif