24 #ifndef PXR_BASE_TF_TYPE_IMPL_H
25 #define PXR_BASE_TF_TYPE_IMPL_H
27 #include "pxr/base/tf/mallocTag.h"
31 template <
class DERIVED,
class BASE>
36 template <
typename TypeVector>
39 template <
typename... Bases>
44 static std::vector<TfType>
47 return std::vector<TfType> {
54 template <
typename Derived>
58 (type->_AddCppCastFunc(
59 typeid(Bases), &Tf_CastToParent<Derived, Bases>), ...);
63 template <
class T,
class BaseTypes>
70 const std::type_info &typeInfo =
typeid(
T);
75 template <
typename T,
typename BaseTypes>
79 TfAutoMallocTag2 tag2(
"Tf",
"TfType::Define");
85 const std::type_info &typeInfo =
typeid(
T);
94 newType._DefineCppType(typeInfo, sizeofType, isPodType, isEnumType);
100 template <
typename T>
104 return Define<T, Bases<> >();
109 template <
class DERIVED,
class BASE>
115 DERIVED* derived =
reinterpret_cast<DERIVED*
>(addr);
116 BASE* base = derived;
120 BASE* base =
reinterpret_cast<BASE*
>(addr);
121 DERIVED* derived =
static_cast<DERIVED*
>(base);
128 #endif // PXR_BASE_TF_TYPE_IMPL_H
static void RegisterCasts(TfType const *type)
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
static TF_API std::string GetCanonicalTypeName(const std::type_info &)
static TfType const & Declare()
static TfType const & Define()
Metafunction returning sizeof(T) for a type T (or 0 if T is a void type).
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_OPEN_SCOPE void * Tf_CastToParent(void *addr, bool derivedToBase)
#define PXR_NAMESPACE_CLOSE_SCOPE
static std::vector< TfType > Declare()