All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TfTypeFunctions< T, ENABLE > Class Template Reference

Implements assorted functions based on compile-time type information. More...

Static Public Member Functions

static const T * GetRawPtr (const T &t)
 
static T & ConstructFromRawPtr (T *ptr)
 
static bool IsNull (const T &)
 
static void Class_Object_MUST_Not_Be_Const ()
 
static void Object_CANNOT_Be_a_Pointer ()
 

Detailed Description

template<class T, class ENABLE = void>
class TfTypeFunctions< T, ENABLE >

Implements assorted functions based on compile-time type information.

TfTypeFunctions<T>::GetRawPtr(T* tPtr) returns tPtr. A smart-pointer class, such as TfRefPtr, may specialize this function to have different behavior. Note that for a non-pointer type, this returns the address of the object, which allows one to uniformly apply the -> operator for member function calls.

TfTypeFunctions<T>::ConstructFromRawPtr(T* tPtr) returns tPtr. Pointer-like objects should specialize this function so that given a raw pointer of type T*, they return a smart pointer pointing to that object (see refPtr.h for an example). Essentially, this is the inverse of TfTypeFunctions<T>::GetRawPtr.

Definition at line 54 of file typeFunctions.h.


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