5#ifndef ICE_PROXY_HANDLE_H
6#define ICE_PROXY_HANDLE_H
8#ifndef ICE_CPP11_MAPPING
18template<
typename T>
class ProxyHandle;
19template<
typename T>
class Handle;
37typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::Object>
ObjectPrx;
40typedef ::IceInternal::Handle< ::Ice::ObjectAdapter> ObjectAdapterPtr;
48typedef ::std::map< ::std::string, ::std::string>
Context;
59checkedCastImpl(const ::Ice::ObjectPrx&, const ::Ice::Context&);
62checkedCastImpl(const ::Ice::ObjectPrx&,
const std::string&, const ::Ice::Context&);
65uncheckedCastImpl(const ::Ice::ObjectPrx&);
68uncheckedCastImpl(const ::Ice::ObjectPrx&,
const std::string&);
73template<
typename T,
typename Y>
inline ProxyHandle<T>
74checkedCastHelper(const ::IceInternal::ProxyHandle<Y>& b, T*, const ::Ice::Context&)
79template<
typename T,
typename Y>
inline ProxyHandle<T>
80uncheckedCastHelper(const ::IceInternal::ProxyHandle<Y>& b, T*)
88template<
typename T,
typename Y>
inline ProxyHandle<T>
89checkedCastHelper(const ::IceInternal::ProxyHandle<Y>& b,
void*, const ::Ice::Context& ctx)
95 const ::Ice::ObjectPrx& o = b;
96 return checkedCastImpl<ProxyHandle<T> >(o, ctx);
98 return checkedCastImpl<ProxyHandle<T> >(b, ctx);
102template<
typename T,
typename Y>
inline ProxyHandle<T>
103uncheckedCastHelper(const ::IceInternal::ProxyHandle<Y>& b,
void*)
109 const ::Ice::ObjectPrx& o = b;
110 return uncheckedCastImpl<ProxyHandle<T> >(o);
112 return uncheckedCastImpl<ProxyHandle<T> >(b);
122class ProxyHandle :
public ::IceUtil::HandleBase<T>
126 ProxyHandle(T* p = 0)
137 ProxyHandle(
const ProxyHandle<Y>& r)
148 ProxyHandle(const ::IceUtil::Handle<Y>& r)
158 ProxyHandle(
const ProxyHandle& r)
176 ProxyHandle& operator=(T* p)
196 ProxyHandle& operator=(
const ProxyHandle<Y>& r)
198 if(this->_ptr != r._ptr)
216 ProxyHandle& operator=(const ::IceUtil::Handle<Y>& r)
218 if(this->_ptr != r._ptr)
235 ProxyHandle& operator=(
const ProxyHandle& r)
237 if(this->_ptr != r._ptr)
254 ::IceProxy::Ice::Object* _upCast()
const
256 return upCast(this->_ptr);
263 return ::IceInternal::checkedCastHelper<T>(r, tag, ctx);
267 static ProxyHandle
checkedCast(
const ProxyHandle<Y>& r,
const std::string& f,
274 const ::Ice::ObjectPrx& o = r;
275 return ::IceInternal::checkedCastImpl<ProxyHandle>(o, f, ctx);
277 return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, ctx);
285 return::IceInternal::uncheckedCastHelper<T>(r, tag);
289 static ProxyHandle
uncheckedCast(
const ProxyHandle<Y>& r,
const std::string& f)
295 const ::Ice::ObjectPrx& o = r;
296 return ::IceInternal::uncheckedCastImpl<ProxyHandle<T> >(o, f);
298 return ::IceInternal::uncheckedCastImpl<ProxyHandle>(r, f);
302 static const std::string& ice_staticId()
304 return T::ice_staticId();
309std::ostream&
operator<<(std::ostream& os, ::IceInternal::ProxyHandle<Y> p)
311 return os << (p ? p->ice_toString() : std::string(
""));
#define ICE_API
Definition Config.h:197
The object adapter provides an up-call interface from the Ice run time to the implementation of Ice o...
Definition ObjectAdapter.h:90
Base class of all object proxies.
Definition Proxy.h:317
Definition BuiltinSequences.h:56
const Context noExplicitContext
Marker value used to indicate that no explicit context was passed to a proxy invocation.
::std::map<::std::string, ::std::string > Context
A request context.
Definition Current.h:68
::std::shared_ptr< P > checkedCast(const ::std::shared_ptr< T > &b, const ::Ice::Context &context=Ice::noExplicitContext)
Downcasts a proxy after confirming the target object's type via a remote invocation.
Definition Proxy.h:1604
std::ostream & operator<<(std::ostream &out, const ProtocolVersion &version)
Definition Protocol.h:179
::std::shared_ptr< P > uncheckedCast(const ::std::shared_ptr< T > &b)
Downcasts a proxy without confirming the target object's type via a remote invocation.
Definition Proxy.h:1557