8 #ifndef SRC_XRDCL_XRDCLFWD_HH_
9 #define SRC_XRDCL_XRDCLFWD_HH_
45 if(
ptr )
throw std::logic_error(
"XrdCl::Fwd already contains value." );
64 if(
ptr )
throw std::logic_error(
"XrdCl::Fwd already contains value." );
117 class Fwd :
protected std::shared_ptr<FwdStorage<T>>
154 *this->
get() = value;
167 *this->
get() = std::move( value );
180 if( !
bool( this->
get()->ptr ) )
throw std::logic_error(
"XrdCl::Fwd contains no value!" );
181 return *this->
get()->ptr;
193 if( !
bool( this->
get()->ptr ) )
throw std::logic_error(
"XrdCl::Fwd contains no value!" );
194 return this->
get()->ptr;
~Memory()
Make sure the destrutor of T wont be called.
Definition: XrdClFwd.hh:90
T & operator*() const
Definition: XrdClFwd.hh:178
T * ptr
Pointer to the forwarded value.
Definition: XrdClFwd.hh:106
Memory for the value.
Definition: XrdClFwd.hh:80
const Fwd & operator=(const T &value) const
Definition: XrdClFwd.hh:152
Fwd(Fwd &&fwd)
Move constructor.
Definition: XrdClFwd.hh:141
Fwd()
Definition: XrdClFwd.hh:127
Memory()
Make sure the default constructor of T wont be called.
Definition: XrdClFwd.hh:85
const Fwd & operator=(T &&value) const
Definition: XrdClFwd.hh:165
FwdStorage()
Default constructor.
Definition: XrdClFwd.hh:29
FwdStorage(const T &value)
Definition: XrdClFwd.hh:35
Memory storage
The memory for storying forwarded value.
Definition: XrdClFwd.hh:101
T * operator->() const
Definition: XrdClFwd.hh:191
T memory
The memory for storing forwarded value.
Definition: XrdClFwd.hh:95
FwdStorage(T &&value)
Definition: XrdClFwd.hh:54
FwdStorage & operator=(T &&value)
Definition: XrdClFwd.hh:62
Definition: XrdClFwd.hh:24
FwdStorage & operator=(const T &value)
Definition: XrdClFwd.hh:43
Fwd(const Fwd &fwd)
Copy constructor.
Definition: XrdClFwd.hh:134
Definition: XrdClFwd.hh:117
~FwdStorage()
Destructor.
Definition: XrdClFwd.hh:72