Loading...
Searching...
No Matches
Vdf_FixedSizeHolder< T, Size > Class Template Reference

Vdf_FixedSizeHolder holds an object of type T of any size, but the sizeof(Vdf_FixedSizeHolder<T>) is always exactly Size. More...

#include <fixedSizeHolder.h>

Public Member Functions

 Vdf_FixedSizeHolder (T const &obj)
 Construct a fixed size holder holding obj.
 
 Vdf_FixedSizeHolder (T &&obj)
 Construct a fixed size holder holding obj.
 
 Vdf_FixedSizeHolder (const Vdf_FixedSizeHolder &other)
 
 Vdf_FixedSizeHolder (Vdf_FixedSizeHolder &&other)
 
Vdf_FixedSizeHolderoperator= (const Vdf_FixedSizeHolder &other)
 
Vdf_FixedSizeHolderoperator= (Vdf_FixedSizeHolder &&other)
 
T const & Get () const
 
T & GetMutable ()
 
void Set (T const &value)
 
void Set (T &&value)
 

Detailed Description

template<class T, size_t Size>
class Vdf_FixedSizeHolder< T, Size >

Vdf_FixedSizeHolder holds an object of type T of any size, but the sizeof(Vdf_FixedSizeHolder<T>) is always exactly Size.

If T's size is less than or equal to Size, it is stored directly in member data. If instead it is greater than Size, it is stored on the heap.

The remote storage policy allows mutation of the object held in the Vdf_FixedSizeHolder, but does this by deep-copying the held object whenever the holder is copied.

Definition at line 106 of file fixedSizeHolder.h.

Constructor & Destructor Documentation

◆ Vdf_FixedSizeHolder() [1/5]

template<class T , size_t Size>
Vdf_FixedSizeHolder ( )
inline

Definition at line 123 of file fixedSizeHolder.h.

◆ Vdf_FixedSizeHolder() [2/5]

template<class T , size_t Size>
Vdf_FixedSizeHolder ( T const & obj)
inlineexplicit

Construct a fixed size holder holding obj.

Definition at line 126 of file fixedSizeHolder.h.

◆ Vdf_FixedSizeHolder() [3/5]

template<class T , size_t Size>
Vdf_FixedSizeHolder ( T && obj)
inlineexplicit

Construct a fixed size holder holding obj.

Definition at line 131 of file fixedSizeHolder.h.

◆ Vdf_FixedSizeHolder() [4/5]

template<class T , size_t Size>
Vdf_FixedSizeHolder ( const Vdf_FixedSizeHolder< T, Size > & other)
inline

Definition at line 135 of file fixedSizeHolder.h.

◆ Vdf_FixedSizeHolder() [5/5]

template<class T , size_t Size>
Vdf_FixedSizeHolder ( Vdf_FixedSizeHolder< T, Size > && other)
inline

Definition at line 140 of file fixedSizeHolder.h.

◆ ~Vdf_FixedSizeHolder()

template<class T , size_t Size>
~Vdf_FixedSizeHolder ( )
inline

Definition at line 145 of file fixedSizeHolder.h.

Member Function Documentation

◆ Get()

template<class T , size_t Size>
T const & Get ( ) const
inline

Definition at line 159 of file fixedSizeHolder.h.

◆ GetMutable()

template<class T , size_t Size>
T & GetMutable ( )
inline

Definition at line 163 of file fixedSizeHolder.h.

◆ operator=() [1/2]

template<class T , size_t Size>
Vdf_FixedSizeHolder & operator= ( const Vdf_FixedSizeHolder< T, Size > & other)
inline

Definition at line 149 of file fixedSizeHolder.h.

◆ operator=() [2/2]

template<class T , size_t Size>
Vdf_FixedSizeHolder & operator= ( Vdf_FixedSizeHolder< T, Size > && other)
inline

Definition at line 154 of file fixedSizeHolder.h.

◆ Set() [1/2]

template<class T , size_t Size>
void Set ( T && value)
inline

Definition at line 171 of file fixedSizeHolder.h.

◆ Set() [2/2]

template<class T , size_t Size>
void Set ( T const & value)
inline

Definition at line 167 of file fixedSizeHolder.h.


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