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

`#include <XrdClFwd.hh>`

Collaboration diagram for XrdCl::FwdStorage< T >:

## Classes

union | Memory
| Memory for the value. More...

## Public Member Functions

| FwdStorage ()
| Default constructor.
| FwdStorage (const T &value)
| FwdStorage (T &&value)
| ~FwdStorage ()
| Destructor.
FwdStorage & | operator= (const T &value)
FwdStorage & | operator= (T &&value)

## Public Attributes

T * | ptr
| Pointer to the forwarded value.
Memory | storage
| The memory for storying forwarded value.

## Detailed Description

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

Helper class for storing forwarded values Allocates memory respectively aligned for T but constructs the object only on assignment.

- T : type of the value

Definition at line 42 of file XrdClFwd.hh.

## Constructor & Destructor Documentation

## FwdStorage() [1/3]

template<typename T>

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

inline

Default constructor.

Definition at line 47 of file XrdClFwd.hh.

: ptr( nullptr ) { }
XrdCl::FwdStorage::ptr
T * ptr
Pointer to the forwarded value.
Definition XrdClFwd.hh:122

References ptr.

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

Here is the caller graph for this function:

## FwdStorage() [2/3]

template<typename T>

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

inline

Constructor from T.

Parameters

  value | : value for forwarding

Definition at line 53 of file XrdClFwd.hh.

: ptr( new( &storage.memory ) T( value ) )
{
}
XrdCl::FwdStorage
Definition XrdClFwd.hh:43
XrdCl::FwdStorage::storage
Memory storage
The memory for storying forwarded value.
Definition XrdClFwd.hh:117

References XrdCl::NullRef< Response >::value, ptr, and storage.

## FwdStorage() [3/3]

template<typename T>

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

inline

Move constructor from T.

Parameters

  value | : value for forwarding

Definition at line 71 of file XrdClFwd.hh.

: ptr( new( &storage.memory ) T( std::move( value ) ) )
{
}

References XrdCl::NullRef< Response >::value, ptr, and storage.

## ~FwdStorage()

template<typename T>

XrdCl::FwdStorage< T >::~FwdStorage | ( |  | ) |

inline

Destructor.

Definition at line 88 of file XrdClFwd.hh.

{
if( ptr ) ptr->~T();
}

References ptr.

## Member Function Documentation

## operator=() [1/2]

template<typename T>

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

inline

Assignment operator from T

Parameters

  value | : value for forwarding

Definition at line 61 of file XrdClFwd.hh.

{
ptr = new( &storage.memory ) T( value );
return *this;
}

References FwdStorage(), XrdCl::NullRef< Response >::value, ptr, and storage.

Here is the call graph for this function:

## operator=() [2/2]

template<typename T>

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

inline

Move assignment operator from T

Parameters

  value | : value for forwarding

Definition at line 79 of file XrdClFwd.hh.

{
ptr = new( &storage.memory ) T( std::move( value ) );
return *this;
}

References FwdStorage(), XrdCl::NullRef< Response >::value, ptr, and storage.

Here is the call graph for this function:

## Member Data Documentation

## ptr

template<typename T>

T* XrdCl::FwdStorage< T >::ptr

Pointer to the forwarded value.

Definition at line 122 of file XrdClFwd.hh.

Referenced by FwdStorage(), FwdStorage(), FwdStorage(), ~FwdStorage(), operator=(), and operator=().

## storage

template<typename T>

Memory XrdCl::FwdStorage< T >::storage

The memory for storying forwarded value.

Definition at line 117 of file XrdClFwd.hh.

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

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

- XrdClFwd.hh