24 #ifndef PXR_BASE_TF_TYPE_FUNCTIONS_H 25 #define PXR_BASE_TF_TYPE_FUNCTIONS_H 34 PXR_NAMESPACE_OPEN_SCOPE
53 template <
class T,
class ENABLE =
void>
56 static T* GetRawPtr(T& t) {
61 static const T* GetRawPtr(
const T& t) {
65 static T& ConstructFromRawPtr(T* ptr) {
return *ptr; }
67 static bool IsNull(
const T&) {
71 static void Class_Object_MUST_Not_Be_Const() { }
72 static void Object_CANNOT_Be_a_Pointer() { }
77 static T* GetRawPtr(T* t) {
81 static T* ConstructFromRawPtr(T* ptr) {
return ptr; }
83 static bool IsNull(T* ptr) {
87 static void Class_Object_MUST_Be_Passed_By_Address() { }
88 static void Class_Object_MUST_Not_Be_Const() { }
93 static const T* GetRawPtr(
const T* t) {
97 static bool IsNull(
const T* ptr) {
101 static const T* ConstructFromRawPtr(T* ptr) {
return ptr; }
102 static void Class_Object_MUST_Be_Passed_By_Address() { }
116 static T* Apply(T value) {
124 static T* Apply(T& value) {
129 PXR_NAMESPACE_CLOSE_SCOPE
131 #endif // PXR_BASE_TF_TYPE_FUNCTIONS_H TfCopyIfNotReference<T>::Apply(v) is used to return a pointer to the value v.
Implements assorted functions based on compile-time type information.