XRootD
Loading...
Searching...
No Matches
XrdCl::Ctx< T > Struct Template Reference

Utility class for storing a pointer to operation context. More...

#include <XrdClCtx.hh>

Inheritance diagram for XrdCl::Ctx< T >:
Collaboration diagram for XrdCl::Ctx< T >:

Public Member Functions

 Ctx ()
 Default constructor.
 Ctx (const Ctx &ctx)
 Copy constructor.
 Ctx (Ctx &&ctx)
 Move constructor.
 Ctx (T &ctx)
 Constructor (from reference)
 Ctx (T *ctx)
 Constructor (from pointer)
T & operator* () const
T * operator-> () const
Ctxoperator= (T &ctx)
 Assignment operator (from reference)
Ctxoperator= (T *ctx)
 Assignment operator (from pointer)

Detailed Description

template<typename T>
struct XrdCl::Ctx< T >

Utility class for storing a pointer to operation context.

Definition at line 38 of file XrdClCtx.hh.

Constructor & Destructor Documentation

◆ Ctx() [1/5]

template<typename T>
XrdCl::Ctx< T >::Ctx ( )
inline

Default constructor.

Definition at line 43 of file XrdClCtx.hh.

44 {
45 }
Utility class for storing a pointer to operation context.
Definition XrdClCtx.hh:39

Referenced by Ctx(), Ctx(), operator=(), and operator=().

Here is the caller graph for this function:

◆ Ctx() [2/5]

template<typename T>
XrdCl::Ctx< T >::Ctx ( T * ctx)
inline

Constructor (from pointer)

Definition at line 50 of file XrdClCtx.hh.

◆ Ctx() [3/5]

template<typename T>
XrdCl::Ctx< T >::Ctx ( T & ctx)
inline

Constructor (from reference)

Definition at line 57 of file XrdClCtx.hh.

◆ Ctx() [4/5]

template<typename T>
XrdCl::Ctx< T >::Ctx ( const Ctx< T > & ctx)
inline

Copy constructor.

Definition at line 64 of file XrdClCtx.hh.

65 {
66 }

References Ctx().

Here is the call graph for this function:

◆ Ctx() [5/5]

template<typename T>
XrdCl::Ctx< T >::Ctx ( Ctx< T > && ctx)
inline

Move constructor.

Definition at line 71 of file XrdClCtx.hh.

72 {
73 }

References Ctx().

Here is the call graph for this function:

Member Function Documentation

◆ operator*()

template<typename T>
T & XrdCl::Ctx< T >::operator* ( ) const
inline

Dereferencing operator. Note if Ctx is a null-reference this will trigger an exception

Returns
: reference to the underlying value
Exceptions
std::logic_error

Definition at line 100 of file XrdClCtx.hh.

101 {
102 if( !bool( *this->get() ) ) throw std::logic_error( "XrdCl::Ctx contains no value!" );
103 return **this->get();
104 }

◆ operator->()

template<typename T>
T * XrdCl::Ctx< T >::operator-> ( ) const
inline

Dereferencing member operator. Note if Ctx is a null-reference this will trigger an exception

Returns
: pointer to the underlying value
Exceptions
std::logic_error

Definition at line 113 of file XrdClCtx.hh.

114 {
115 if( !bool( *this->get() ) ) throw std::logic_error( "XrdCl::Ctx contains no value!" );
116 return *this->get();
117 }

◆ operator=() [1/2]

template<typename T>
Ctx & XrdCl::Ctx< T >::operator= ( T & ctx)
inline

Assignment operator (from reference)

Definition at line 87 of file XrdClCtx.hh.

88 {
89 *this->get() = &ctx;
90 return *this;
91 }

References Ctx().

Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T>
Ctx & XrdCl::Ctx< T >::operator= ( T * ctx)
inline

Assignment operator (from pointer)

Definition at line 78 of file XrdClCtx.hh.

79 {
80 *this->get() = ctx;
81 return *this;
82 }

References Ctx().

Here is the call graph for this function:

The documentation for this struct was generated from the following file: