HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TfAnyUniquePtr Class Reference

#include <anyUniquePtr.h>

Public Member Functions

 TfAnyUniquePtr (TfAnyUniquePtr &&other)
 
TfAnyUniquePtroperator= (TfAnyUniquePtr &&other)
 
 TfAnyUniquePtr (TfAnyUniquePtr const &)=delete
 
TfAnyUniquePtroperator= (TfAnyUniquePtr const &)=delete
 
 ~TfAnyUniquePtr ()
 
void const * Get () const
 Return a pointer to the owned object. More...
 

Static Public Member Functions

template<typename T >
static TfAnyUniquePtr New ()
 
template<typename T >
static TfAnyUniquePtr New (T const &v)
 

Detailed Description

A simple type-erased container that provides only destruction, moves and immutable, untyped access to the held value.

There are a couple of facilities that provide fallback or default values in error cases. TfAnyUniquePtr exists to hold these oft-instantiated but rarely accessed values. As such, its design prioritizes compile-time overhead over runtime performance and avoids clever metaprogramming. Please resist the urge to add functionality to this class (e.g. small object optimization, hboost::python interoperability.)

Definition at line 43 of file anyUniquePtr.h.

Constructor & Destructor Documentation

TfAnyUniquePtr::TfAnyUniquePtr ( TfAnyUniquePtr &&  other)
inline

Definition at line 58 of file anyUniquePtr.h.

TfAnyUniquePtr::TfAnyUniquePtr ( TfAnyUniquePtr const &  )
delete
TfAnyUniquePtr::~TfAnyUniquePtr ( )
inline

Definition at line 81 of file anyUniquePtr.h.

Member Function Documentation

void const* TfAnyUniquePtr::Get ( ) const
inline

Return a pointer to the owned object.

Definition at line 86 of file anyUniquePtr.h.

template<typename T >
static TfAnyUniquePtr TfAnyUniquePtr::New ( )
inlinestatic

Definition at line 47 of file anyUniquePtr.h.

template<typename T >
static TfAnyUniquePtr TfAnyUniquePtr::New ( T const &  v)
inlinestatic

Definition at line 53 of file anyUniquePtr.h.

TfAnyUniquePtr& TfAnyUniquePtr::operator= ( TfAnyUniquePtr &&  other)
inline

Definition at line 68 of file anyUniquePtr.h.

TfAnyUniquePtr& TfAnyUniquePtr::operator= ( TfAnyUniquePtr const &  )
delete

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