26#include <Ice/ProxyHandle.h>
28#include <ArmarXCore/interface/core/util/distributed/RemoteHandle/ClientSideRemoteHandleControlBlock.h>
29#include <ArmarXCore/interface/core/util/distributed/RemoteHandle/RemoteHandleControlBlock.h>
45 template <
class PrxType>
50 "PrxType has to be an Ice proxy");
57 RemoteHandle(
const ClientSideRemoteHandleControlBlockBasePtr& controlBlock);
59 template <
class PrxTypeB>
67 operator=(
const ClientSideRemoteHandleControlBlockBasePtr& controlBlock);
69 template <
class PrxTypeB>
73 template <
class SourceType>
76 template <
class SourceType>
79 template <
class TargetPrxType>
81 template <
class TargetPrxType>
84 explicit inline operator bool()
const;
92 inline const PrxType
get()
const;
95 template <
class PrxTA,
class PrxTB>
97 template <
class PrxTA,
class PrxTB>
99 template <
class PrxTA,
class PrxTB>
101 template <
class PrxTA,
class PrxTB>
103 template <
class PrxTA,
class PrxTB>
105 template <
class PrxTA,
class PrxTB>
116 template <
class PrxTA>
120 ClientSideRemoteHandleControlBlockBasePtr clientSideControlBlock;
123 template <
class PrxType>
125 const ClientSideRemoteHandleControlBlockBasePtr& controlBlock) :
126 objectProxy{controlBlock ? PrxType::
checkedCast(controlBlock->getManagedObjectProxy())
128 clientSideControlBlock{objectProxy ? controlBlock : nullptr}
130 assert(objectProxy ? clientSideControlBlock : !clientSideControlBlock);
133 template <
class PrxType>
134 template <
class PrxTypeB>
140 template <
class PrxType>
145 controlBlock ? PrxType::checkedCast(controlBlock->getManagedObjectProxy()) :
nullptr;
146 clientSideControlBlock = objectProxy ? controlBlock :
nullptr;
150 template <
class PrxType>
154 objectProxy =
nullptr;
155 clientSideControlBlock =
nullptr;
159 template <
class PrxType>
160 template <
class PrxTypeB>
164 this = other.clientSideControlBlock;
168 template <
class PrxType>
173 template <
class PrxType>
174 template <
class SourceType>
180 "proxyToCast has to be a RemoteHandle");
184 template <
class PrxType>
185 template <
class SourceType>
191 "proxyToCast has to be a RemoteHandle");
195 template <
class PrxType>
196 template <
class TargetPrxType>
202 "TargetPrxType has to be an Ice proxy");
204 casted.clientSideControlBlock = clientSideControlBlock;
205 casted.objectProxy = TargetPrxType::uncheckedCast(objectProxy);
209 template <
class PrxType>
210 template <
class TargetPrxType>
216 "TargetPrxType has to be an Ice proxy");
218 casted.objectProxy = TargetPrxType::checkedCast(objectProxy);
219 casted.clientSideControlBlock = casted.objectProxy ? clientSideControlBlock :
nullptr;
223 template <
class PrxType>
230 template <
class PrxType>
237 template <
class PrxType>
244 template <
class PrxType>
251 template <
class PrxType>
258 template <
class PrxType>
265 template <
class PrxType>
271 template <
class PrxType>
275 return clientSideControlBlock;
278 template <
class PrxTA,
class PrxTB>
282 return fst.clientSideControlBlock->getManagedObjectProxy() ==
283 snd.clientSideControlBlock->getManagedObjectProxy();
286 template <
class PrxTA,
class PrxTB>
290 return fst.clientSideControlBlock->getManagedObjectProxy() !=
291 snd.clientSideControlBlock->getManagedObjectProxy();
294 template <
class PrxTA,
class PrxTB>
298 return fst.clientSideControlBlock->getManagedObjectProxy() <
299 snd.clientSideControlBlock->getManagedObjectProxy();
302 template <
class PrxTA,
class PrxTB>
306 return fst.clientSideControlBlock->getManagedObjectProxy() <=
307 snd.clientSideControlBlock->getManagedObjectProxy();
310 template <
class PrxTA,
class PrxTB>
314 return fst.clientSideControlBlock->getManagedObjectProxy() >
315 snd.clientSideControlBlock->getManagedObjectProxy();
318 template <
class PrxTA,
class PrxTB>
322 return fst.clientSideControlBlock->getManagedObjectProxy() >=
323 snd.clientSideControlBlock->getManagedObjectProxy();
The RemoteHandle class wrapps a ClientSideRemoteHandleControlBlock and can be used just as a Ice prox...
const IceInternal::Handle< const ClientSideRemoteHandleControlBlockBase > getclientSideControlBlock() const
friend bool operator>=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
RemoteHandle(const ClientSideRemoteHandleControlBlockBasePtr &controlBlock)
const PrxType operator->() const
RemoteHandle< PrxType > & operator=(std::nullptr_t)
friend bool operator<=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
RemoteHandle(RemoteHandle &&other)=default
RemoteHandle< PrxType > & operator=(const RemoteHandle< PrxType > &other)=default
friend bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
RemoteHandle(std::nullptr_t)
friend class armarx::RemoteHandle
RemoteHandle(const RemoteHandle &other)=default
RemoteHandle(const RemoteHandle< PrxTypeB > &other)
const PrxType get() const
friend bool operator<(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
friend bool operator>(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
const PrxType operator*() const
RemoteHandle< TargetPrxType > checkedCast() const
RemoteHandle< PrxType > & operator=(RemoteHandle< PrxType > &&other)=default
static RemoteHandle< PrxType > checkedCast(const SourceType &proxyToCast)
friend bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
RemoteHandle< TargetPrxType > uncheckedCast() const
RemoteHandle< PrxType > & operator=(const RemoteHandle< PrxTypeB > &other)
RemoteHandle< PrxType > & operator=(const ClientSideRemoteHandleControlBlockBasePtr &controlBlock)
static RemoteHandle< PrxType > uncheckedCast(const SourceType &proxyToCast)
This file offers overloads of toIce() and fromIce() functions for STL container types.
bool operator>=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
bool operator<=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
bool operator<(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
bool operator>(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)