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

`#include <XrdClFwd.hh>`

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

## Public Member Functions

| Fwd ()
| Fwd (const Fwd &fwd)
| Copy constructor.
| Fwd (const T &value)
| Constructor from value.
| Fwd (Fwd &&fwd)
| Move constructor.
| Fwd (std::shared_ptr< FwdStorage< T > > &&ptr)
| Initialize from shared_ptr.
| Fwd (T &&value)
| Move construct from value.
T & | operator* () const
T * | operator-> () const
Fwd & | operator= (const T &value)
Fwd & | operator= (T &&value)
bool | Valid () const
| Check if it contains a valid value.

## Detailed Description

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

A helper class for forwarding arguments between operations. In practice it's a wrapper around std::shared_ptr using FwdStorage as underlying memory.

- T : type of forwarded value

Definition at line 133 of file XrdClFwd.hh.

## Constructor & Destructor Documentation

## Fwd() [1/6]

template<typename T>

XrdCl::Fwd< T >::Fwd | ( |  | ) |

inline

Default constructor.

Allocates memory for the underlying value object without callying its constructor.

Definition at line 141 of file XrdClFwd.hh.

: std::shared_ptr<FwdStorage<T>>( std::make_shared<FwdStorage<T>>() )
{
}
XrdCl::Fwd
Definition XrdClFwd.hh:134

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

Here is the caller graph for this function:

## Fwd() [2/6]

template<typename T>

XrdCl::Fwd< T >::Fwd | ( | const Fwd< T > & | fwd | ) |

inline

Copy constructor.

Definition at line 148 of file XrdClFwd.hh.

: std::shared_ptr<FwdStorage<T>>( fwd )
{
}

References Fwd().

Here is the call graph for this function:

## Fwd() [3/6]

template<typename T>

XrdCl::Fwd< T >::Fwd | ( | Fwd< T > && | fwd | ) |

inline

Move constructor.

Definition at line 155 of file XrdClFwd.hh.

: std::shared_ptr<FwdStorage<T>>( std::move( fwd ) )
{
}

References Fwd().

Here is the call graph for this function:

## Fwd() [4/6]

template<typename T>

XrdCl::Fwd< T >::Fwd | ( | std::shared_ptr< FwdStorage< T > > && | ptr | ) |

inline

Initialize from shared_ptr.

Definition at line 162 of file XrdClFwd.hh.

: std::shared_ptr<FwdStorage<T>>( std::move( ptr ) )
{
}

## Fwd() [5/6]

template<typename T>

XrdCl::Fwd< T >::Fwd | ( | const T & | value | ) |

inline explicit

Constructor from value.

Definition at line 169 of file XrdClFwd.hh.

{
*this->get() = value;
}

References XrdCl::NullRef< Response >::value.

## Fwd() [6/6]

template<typename T>

XrdCl::Fwd< T >::Fwd | ( | T && | value | ) |

inline explicit

Move construct from value.

Definition at line 177 of file XrdClFwd.hh.

{
*this->get() = std::move( value );
}

References XrdCl::NullRef< Response >::value.

## Member Function Documentation

## operator*()

template<typename T>

T & XrdCl::Fwd< T >::operator* | ( |  | ) | const

inline

Dereferencing operator. Note if Fwd has not been assigned with a value this will trigger an exception

Returns
  : reference to the underlying value

Exceptions

  | std::logic_error

Definition at line 213 of file XrdClFwd.hh.

{
if( !bool( this->get()->ptr ) ) throw std::logic_error( "XrdCl::Fwd contains no value!" );
return *this->get()->ptr;
}

## operator->()

template<typename T>

T * XrdCl::Fwd< T >::operator-> | ( |  | ) | const

inline

Dereferencing member operator. Note if Fwd has not been assigned with a value this will trigger an exception

Returns
  : pointer to the underlying value

Exceptions

  | std::logic_error

Definition at line 226 of file XrdClFwd.hh.

{
if( !bool( this->get()->ptr ) ) throw std::logic_error( "XrdCl::Fwd contains no value!" );
return this->get()->ptr;
}

## operator=() [1/2]

template<typename T>

Fwd & XrdCl::Fwd< T >::operator= | ( | const T & | value | ) |

inline

Assignment operator.

Parameters

  value | : forwarded value

Exceptions

  | std::logic_error

Definition at line 188 of file XrdClFwd.hh.

{
*this->get() = value;
return *this;
}

References Fwd(), and XrdCl::NullRef< Response >::value.

Here is the call graph for this function:

## operator=() [2/2]

template<typename T>

Fwd & XrdCl::Fwd< T >::operator= | ( | T && | value | ) |

inline

Move assignment operator.

Parameters

  value | : forwarded value

Exceptions

  | std::logic_error

Definition at line 200 of file XrdClFwd.hh.

{
*this->get() = std::move( value );
return *this;
}

References Fwd(), and XrdCl::NullRef< Response >::value.

Here is the call graph for this function:

## Valid()

template<typename T>

bool XrdCl::Fwd< T >::Valid | ( |  | ) | const

inline

Check if it contains a valid value.

Definition at line 235 of file XrdClFwd.hh.

{
return bool( this->get()->ptr );
}

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

- XrdClFwd.hh