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

Member Function Documentation

◆ Class_Object_MUST_Not_Be_Const()

static void Class_Object_MUST_Not_Be_Const ( )
inlinestatic

Definition at line 71 of file typeFunctions.h.

◆ ConstructFromRawPtr()

static T & ConstructFromRawPtr ( T *  ptr)
inlinestatic

Definition at line 65 of file typeFunctions.h.

◆ GetRawPtr()

static const T * GetRawPtr ( const T &  t)
inlinestatic

Definition at line 61 of file typeFunctions.h.

◆ IsNull()

static bool IsNull ( const T &  )
inlinestatic

Definition at line 67 of file typeFunctions.h.

◆ Object_CANNOT_Be_a_Pointer()

static void Object_CANNOT_Be_a_Pointer ( )
inlinestatic

Definition at line 72 of file typeFunctions.h.


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