blob: 237c31f9606da35539631d701217be70f2716160 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifndef ICETRAY_TESTSETUP_H
#define ICETRAY_TESTSETUP_H
#include <Ice/Communicator.h>
#include <IceBox/IceBox.h>
#include <visibility.h>
#include "icetrayService.h"
#include "icecube.h"
namespace IceTray {
class DLL_PUBLIC DryIce : private Cube {
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;
void replace(const std::string &, const Ice::ObjectPtr &);
template<typename T, typename I, typename ... Args>
static auto replace(const Args & ... args)
{
pm()->remove<CubePlugIn>(typeid(T).name());
return add<T, I>(args...);
}
Ice::CommunicatorPtr ic;
IceTray::ServicePtr s;
};
class DLL_PUBLIC DryIceClient {
public:
DryIceClient();
virtual ~DryIceClient();
template<typename Prx>
std::shared_ptr<Prx> getProxy(const std::string & objectName) const
{
return Ice::checkedCast<Prx>(DryIce::currentDryIce->ic->stringToProxy(objectName));
}
ServicePtr getService() const;
Ice::ObjectAdapterPtr getAdapter() const;
private:
Ice::ObjectAdapterPtr adapter;
};
}
#endif
|