26 #ifndef SRC_XRDCL_XRDCLCTX_HH_ 27 #define SRC_XRDCL_XRDCLCTX_HH_ 37 struct Ctx :
protected std::shared_ptr<T*>
42 Ctx() :
std::shared_ptr<T*>(
std::make_shared<T*>() )
49 Ctx( T *ctx ) :
std::shared_ptr<T*>(
std::make_shared<T*>( ctx ) )
56 Ctx( T &ctx ) :
std::shared_ptr<T*>(
std::make_shared<T*>( &ctx ) )
101 if( !
bool( *this->
get() ) )
throw std::logic_error(
"XrdCl::Ctx contains no value!" );
102 return **this->
get();
114 if( !
bool( *this->
get() ) )
throw std::logic_error(
"XrdCl::Ctx contains no value!" );
T & operator*() const
Definition: XrdClCtx.hh:99
Utility class for storing a pointer to operation context.
Definition: XrdClCtx.hh:37
Ctx & operator=(T &ctx)
Assignment operator (from reference)
Definition: XrdClCtx.hh:86
Ctx(Ctx &&ctx)
Move constructor.
Definition: XrdClCtx.hh:70
Ctx(const Ctx &ctx)
Copy constructor.
Definition: XrdClCtx.hh:63
Ctx(T &ctx)
Constructor (from reference)
Definition: XrdClCtx.hh:56
Definition: XrdClAnyObject.hh:25
Ctx & operator=(T *ctx)
Assignment operator (from pointer)
Definition: XrdClCtx.hh:77
Ctx()
Default constructor.
Definition: XrdClCtx.hh:42
Ctx(T *ctx)
Constructor (from pointer)
Definition: XrdClCtx.hh:49
T * operator->() const
Definition: XrdClCtx.hh:112