8#ifndef PXR_BASE_VT_VALUE_COMPOSE_OVER_H
9#define PXR_BASE_VT_VALUE_COMPOSE_OVER_H
13#include "pxr/base/vt/api.h"
16#include "pxr/base/vt/value.h"
17#include "pxr/base/vt/valueRef.h"
21PXR_NAMESPACE_OPEN_SCOPE
42VT_API std::optional<VtValue>
70Vt_RegisterComposeOver(std::type_info
const &strongType,
71 std::type_info
const &weakType,
78template <
class Ret,
class Strong,
class Weak>
80VtRegisterComposeOver(Ret (*fn)(Strong
const &, Weak
const &))
83 "Unexpected compose-over registration for one of the "
87 "Use VT_VALUE_TYPE_COMPOSES or specialize "
88 "VtValueTypeCanCompose<> before registering compose-over "
91 using TypedFn = Ret (*)(Strong
const &, Weak
const &);
92 using VoidFn = void (*)();
94 VoidFn voidFn =
reinterpret_cast<VoidFn
>(fn);
95 Vt_RegisterComposeOver(
96 typeid(Strong),
typeid(Weak), voidFn,
98 TypedFn tFn =
reinterpret_cast<TypedFn
>(vFn);
107PXR_NAMESPACE_CLOSE_SCOPE
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
A non-owning type-erased view of a value, interoperating with VtValue.
bool CanComposeOver() const
Return true if this value holds a type that has been declared at compile time to support composing ov...
_TypeInfoFor< T >::GetObjResultType UncheckedGet() const
Return a const reference to the viewed object if the viewed object is of type T.
bool IsHolding() const
Return true if this value is viewing an object of type T, false otherwise.
#define TF_DEV_AXIOM(cond)
The same as TF_AXIOM, but compiled only in dev builds.
A special sentinel type and singular value that can be used to "finalize" a composing type.
A trait to detect instantiations of VtArrayEdit, specialized in arrayEdit.h.
A trait indicating whether VtValue compose-over functionality can be registered for a type.