HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_COWValue< T >::Rep Class Reference

#include <UT_COWValue.h>

Protected Types

typedef T element_type
 

Protected Member Functions

 Rep ()
 
 Rep (const T &data)
 
 Rep (T &&data)
 
template<typename... Args>
 Rep (std::in_place_t, Args &&...args)
 
 Rep (ImmortalTag)
 
 Rep (const Rep &other)=delete
 
Rep & operator= (const Rep &other)=delete
 
 ~Rep ()
 
bool isUnique () const
 
bool isImmortal () const
 
exint refCount () const
 
T * data ()
 
const T * data () const
 

Static Protected Member Functions

static const Rep * getStaticEmpty ()
 

Friends

class UT_COWValue< T >
 

Detailed Description

template<typename T>
class UT_COWValue< T >::Rep

The actual control block for a value referenced by (potentially multiple) UT_COWValues

These can be in one of three states:

  • unique: only one UT_COWValue has mutable access to the data stored
  • nonunique: multiple UT_COWValues have const access to the data stored
  • immortal: an arbitrary number of UT_COWValues have const access to the read-only data stored

Immortal Reps are used to provide a cheap global default-constructed version of the contained type.

Definition at line 159 of file UT_COWValue.h.

Member Typedef Documentation

template<typename T>
typedef T UT_COWValue< T >::Rep::element_type
protected

Definition at line 171 of file UT_COWValue.h.

Constructor & Destructor Documentation

template<typename T>
UT_COWValue< T >::Rep::Rep ( )
inlineprotected

Definition at line 173 of file UT_COWValue.h.

template<typename T>
UT_COWValue< T >::Rep::Rep ( const T &  data)
inlineprotected

Definition at line 174 of file UT_COWValue.h.

template<typename T>
UT_COWValue< T >::Rep::Rep ( T &&  data)
inlineprotected

Definition at line 175 of file UT_COWValue.h.

template<typename T>
template<typename... Args>
UT_COWValue< T >::Rep::Rep ( std::in_place_t  ,
Args &&...  args 
)
inlineprotected

Definition at line 177 of file UT_COWValue.h.

template<typename T>
UT_COWValue< T >::Rep::Rep ( ImmortalTag  )
inlineexplicitprotected

Construct the global immortal Rep for this type – should only be called by getStaticEmpty().

Definition at line 183 of file UT_COWValue.h.

template<typename T>
UT_COWValue< T >::Rep::Rep ( const Rep &  other)
protecteddelete
template<typename T>
UT_COWValue< T >::Rep::~Rep ( )
inlineprotected

Definition at line 190 of file UT_COWValue.h.

Member Function Documentation

template<typename T>
T* UT_COWValue< T >::Rep::data ( )
inlineprotected

Definition at line 205 of file UT_COWValue.h.

template<typename T>
const T* UT_COWValue< T >::Rep::data ( ) const
inlineprotected

Definition at line 206 of file UT_COWValue.h.

template<typename T>
static const Rep* UT_COWValue< T >::Rep::getStaticEmpty ( )
inlinestaticprotected

Return the global static immortal default-constructed Rep for the type.

Definition at line 210 of file UT_COWValue.h.

template<typename T>
bool UT_COWValue< T >::Rep::isImmortal ( ) const
inlineprotected

Definition at line 196 of file UT_COWValue.h.

template<typename T>
bool UT_COWValue< T >::Rep::isUnique ( ) const
inlineprotected

Definition at line 192 of file UT_COWValue.h.

template<typename T>
Rep& UT_COWValue< T >::Rep::operator= ( const Rep &  other)
protecteddelete
template<typename T>
exint UT_COWValue< T >::Rep::refCount ( ) const
inlineprotected

Definition at line 200 of file UT_COWValue.h.

Friends And Related Function Documentation

template<typename T>
friend class UT_COWValue< T >
friend

Definition at line 161 of file UT_COWValue.h.


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