5 #ifndef ICE_PROXY_HANDLE_H
6 #define ICE_PROXY_HANDLE_H
8 #ifndef ICE_CPP11_MAPPING // C++98 mapping
18 template<
typename T>
class ProxyHandle;
19 template<
typename T>
class Handle;
37 typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::Object> ObjectPrx;
40 typedef ::IceInternal::Handle< ::Ice::ObjectAdapter> ObjectAdapterPtr;
48 typedef ::std::map< ::std::string, ::std::string>
Context;
58 template<
typename P> P
61 template<
typename P> P
64 template<
typename P> P
65 uncheckedCastImpl(const ::Ice::ObjectPrx&);
67 template<
typename P> P
68 uncheckedCastImpl(const ::Ice::ObjectPrx&,
const std::string&);
73 template<
typename T,
typename Y>
inline ProxyHandle<T>
79 template<
typename T,
typename Y>
inline ProxyHandle<T>
80 uncheckedCastHelper(const ::IceInternal::ProxyHandle<Y>& b, T*)
88 template<
typename T,
typename Y>
inline ProxyHandle<T>
95 const ::Ice::ObjectPrx& o = b;
96 return checkedCastImpl<ProxyHandle<T> >(o, ctx);
98 return checkedCastImpl<ProxyHandle<T> >(b, ctx);
102 template<
typename T,
typename Y>
inline ProxyHandle<T>
103 uncheckedCastHelper(const ::IceInternal::ProxyHandle<Y>& b,
void*)
109 const ::Ice::ObjectPrx& o = b;
110 return uncheckedCastImpl<ProxyHandle<T> >(o);
112 return uncheckedCastImpl<ProxyHandle<T> >(b);
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();
309 std::ostream&
operator<<(std::ostream& os, ::IceInternal::ProxyHandle<Y> p)
311 return os << (p ? p->ice_toString() : std::string(
""));