26 #ifndef SRC_XRDCL_XRDCLCTX_HH_
27 #define SRC_XRDCL_XRDCLCTX_HH_
38 struct Ctx :
protected std::shared_ptr<T*>
43 Ctx() :
std::shared_ptr<T*>(
std::make_shared<T*>() )
50 Ctx( T *ctx ) :
std::shared_ptr<T*>(
std::make_shared<T*>( ctx ) )
57 Ctx( T &ctx ) :
std::shared_ptr<T*>(
std::make_shared<T*>( &ctx ) )
102 if( !
bool( *this->
get() ) )
throw std::logic_error(
"XrdCl::Ctx contains no value!" );
103 return **this->
get();
115 if( !
bool( *this->
get() ) )
throw std::logic_error(
"XrdCl::Ctx contains no value!" );
Definition: XrdClAction.hh:34
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
Definition: XrdOucJson.hh:4497
Definition: XrdOucJson.hh:4517
Utility class for storing a pointer to operation context.
Definition: XrdClCtx.hh:39
Ctx(T &ctx)
Constructor (from reference)
Definition: XrdClCtx.hh:57
Ctx(T *ctx)
Constructor (from pointer)
Definition: XrdClCtx.hh:50
T & operator*() const
Definition: XrdClCtx.hh:100
Ctx & operator=(T *ctx)
Assignment operator (from pointer)
Definition: XrdClCtx.hh:78
Ctx(const Ctx &ctx)
Copy constructor.
Definition: XrdClCtx.hh:64
Ctx & operator=(T &ctx)
Assignment operator (from reference)
Definition: XrdClCtx.hh:87
T * operator->() const
Definition: XrdClCtx.hh:113
Ctx()
Default constructor.
Definition: XrdClCtx.hh:43
Ctx(Ctx &&ctx)
Move constructor.
Definition: XrdClCtx.hh:71