HDK
|
This base class for ValueAccessors manages registration of an accessor with a tree so that the tree can automatically clear the accessor whenever one of its nodes is deleted. More...
#include <ValueAccessor.h>
Public Member Functions | |
ValueAccessorBase (TreeType &tree) | |
Construct from a tree. Should rarely be invoked directly, the drived implementation class calls this. Remains public for backwards compatibility. More... | |
virtual | ~ValueAccessorBase () |
ValueAccessorBase (const ValueAccessorBase &other) | |
Copy constructor - if IsSafe, then the copy also registers itself against the tree it is accessing. More... | |
ValueAccessorBase & | operator= (const ValueAccessorBase &other) |
TreeType * | getTree () const |
Return a pointer to the tree associated with this accessor. More... | |
TreeType & | tree () const |
Return a reference to the tree associated with this accessor. More... | |
virtual void | clear ()=0 |
Pure virtual method, clears the derived accessor. More... | |
Static Public Member Functions | |
static constexpr bool | isSafe () |
Return true if this accessor is safe, i.e. registered by the tree from which it is constructed. Un-registered accessors can in rare cases be faster because it avoids the (small) overhead of registration, but they are unsafe if the tree is modified. So unless you're an expert it is highly recommended to set IsSafe = true (which is the default). More... | |
Static Public Attributes | |
static constexpr bool | IsConstTree = std::is_const<TreeType>::value |
Returns true if this accessor is operating on a const tree type. More... | |
Protected Member Functions | |
virtual void | release () |
Protected Attributes | |
TreeType * | mTree |
Friends | |
template<typename > | |
class | Tree |
This base class for ValueAccessors manages registration of an accessor with a tree so that the tree can automatically clear the accessor whenever one of its nodes is deleted.
Definition at line 151 of file ValueAccessor.h.
|
inline |
Construct from a tree. Should rarely be invoked directly, the drived implementation class calls this. Remains public for backwards compatibility.
Definition at line 168 of file ValueAccessor.h.
|
inlinevirtual |
Definition at line 174 of file ValueAccessor.h.
|
inline |
Copy constructor - if IsSafe, then the copy also registers itself against the tree it is accessing.
Definition at line 178 of file ValueAccessor.h.
|
pure virtual |
Pure virtual method, clears the derived accessor.
Implemented in openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< TreeType, IsSafe, MutexT, IndexSequence >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< TreeT >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeType, IsSafe >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeType >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeT, false >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeT >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< IntTreeT >, and openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< TreeType >.
|
inline |
Return a pointer to the tree associated with this accessor.
The pointer will be null only if the tree from which this accessor was constructed was subsequently deleted (which generally leaves the accessor in an unsafe state).
Definition at line 198 of file ValueAccessor.h.
|
inlinestatic |
Return true if this accessor is safe, i.e. registered by the tree from which it is constructed. Un-registered accessors can in rare cases be faster because it avoids the (small) overhead of registration, but they are unsafe if the tree is modified. So unless you're an expert it is highly recommended to set IsSafe = true (which is the default).
Definition at line 163 of file ValueAccessor.h.
|
inline |
Definition at line 184 of file ValueAccessor.h.
|
inlineprotectedvirtual |
Reimplemented in openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< TreeType, IsSafe, MutexT, IndexSequence >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< TreeT >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeType, IsSafe >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeType >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeT, false >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< const TreeT >, openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< IntTreeT >, and openvdb::OPENVDB_VERSION_NAME::tree::ValueAccessorImpl< TreeType >.
Definition at line 209 of file ValueAccessor.h.
|
inline |
Return a reference to the tree associated with this accessor.
Definition at line 201 of file ValueAccessor.h.
Definition at line 208 of file ValueAccessor.h.
|
static |
Returns true if this accessor is operating on a const tree type.
Definition at line 155 of file ValueAccessor.h.
|
protected |
Definition at line 210 of file ValueAccessor.h.