11 #ifndef OPENVDB_TREE_NODEUNION_HAS_BEEN_INCLUDED 12 #define OPENVDB_TREE_NODEUNION_HAS_BEEN_INCLUDED 14 #include <openvdb/version.h> 17 #include <type_traits> 30 template<
typename ValueT,
typename ChildT,
typename Enable =
void>
41 void setChild(ChildT* child) { mChild = child; }
43 const ValueT&
getValue()
const {
return mValue; }
45 void setValue(
const ValueT& val) { mValue = val; }
52 !std::is_same<ValueT, math::Coord>::value &&
53 !std::is_arithmetic<ValueT>::value,
54 "Unexpected instantiation of NodeUnion");
59 template<
typename ValueT,
typename ChildT>
61 typename
std::enable_if<std::is_trivially_copyable<ValueT>::value>::type>
64 union { ChildT* mChild; ValueT
mValue; };
70 void setChild(ChildT* child) { mChild = child; }
72 const ValueT&
getValue()
const {
return mValue; }
74 void setValue(
const ValueT& val) { mValue = val; }
85 #endif // OPENVDB_TREE_NODEUNION_HAS_BEEN_INCLUDED NodeUnion()
Definition: NodeUnion.h:38
ValueT mValue
Definition: NodeUnion.h:64
const ValueT & getValue() const
Definition: NodeUnion.h:43
const ValueT & getValue() const
Definition: NodeUnion.h:72
Default implementation of a NodeUnion that stores the child pointer and the value separately (i...
Definition: NodeUnion.h:31
void setChild(ChildT *child)
Definition: NodeUnion.h:70
ChildT * getChild() const
Definition: NodeUnion.h:40
void setValue(const ValueT &val)
Definition: NodeUnion.h:45
void setChild(ChildT *child)
Definition: NodeUnion.h:41
Definition: Exceptions.h:13
ValueT & getValue()
Definition: NodeUnion.h:44
NodeUnion()
Definition: NodeUnion.h:67
ValueT & getValue()
Definition: NodeUnion.h:73
ChildT * getChild() const
Definition: NodeUnion.h:69
void setValue(const ValueT &val)
Definition: NodeUnion.h:74
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218