Loading...
Searching...
No Matches
TfTypeFunctions< T, ENABLE > Class Template Reference

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

#include <typeFunctions.h>

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 37 of file typeFunctions.h.

Member Function Documentation

◆ Class_Object_MUST_Not_Be_Const()

template<class T , class ENABLE = void>
static void Class_Object_MUST_Not_Be_Const ( )
inlinestatic

Definition at line 54 of file typeFunctions.h.

◆ ConstructFromRawPtr()

template<class T , class ENABLE = void>
static T & ConstructFromRawPtr ( T * ptr)
inlinestatic

Definition at line 48 of file typeFunctions.h.

◆ GetRawPtr()

template<class T , class ENABLE = void>
static const T * GetRawPtr ( const T & t)
inlinestatic

Definition at line 44 of file typeFunctions.h.

◆ IsNull()

template<class T , class ENABLE = void>
static bool IsNull ( const T & )
inlinestatic

Definition at line 50 of file typeFunctions.h.

◆ Object_CANNOT_Be_a_Pointer()

template<class T , class ENABLE = void>
static void Object_CANNOT_Be_a_Pointer ( )
inlinestatic

Definition at line 55 of file typeFunctions.h.


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