OpenVDB 13.0.0

Loading...
Searching...
No Matches
ValueAccessorBase< TreeType, IsSafe > Class Template Referenceabstract

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 <openvdb/tree/ValueAccessor.h>`

Inheritance diagram for ValueAccessorBase< TreeType, IsSafe >:

## 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.
virtual | ~ValueAccessorBase ()
| ValueAccessorBase (const ValueAccessorBase &other)
| Copy constructor - if IsSafe, then the copy also registers itself against the tree it is accessing.
ValueAccessorBase & | operator= (const ValueAccessorBase &other)
TreeType * | getTree () const
| Return a pointer to the tree associated with this accessor.
TreeType & | tree () const
| Return a reference to the tree associated with this accessor.
virtual void | clear ()=0
| Pure virtual method, clears the derived accessor.

## 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).

## Static Public Attributes
static constexpr bool | IsConstTree = std::is_const<TreeType>::value
| Returns true if this accessor is operating on a const tree type.

## Protected Member Functions
virtual void | release ()

## Protected Attributes
TreeType * | mTree

## Friends
template<typename>
class | Tree

## Detailed Description

template<typename TreeType, bool IsSafe>
class openvdb::v13_0::tree::ValueAccessorBase< TreeType, IsSafe >

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.

## Constructor & Destructor Documentation

## ◆ ValueAccessorBase() [1/2]

template<typename TreeType, bool IsSafe>

ValueAccessorBase | ( | TreeType & | tree | ) |
| inline

Construct from a tree. Should rarely be invoked directly, the drived implementation class calls this. Remains public for backwards compatibility.

## ◆ ~ValueAccessorBase()

template<typename TreeType, bool IsSafe>

virtual ~ValueAccessorBase | ( |  | ) |
| inline virtual

## ◆ ValueAccessorBase() [2/2]

template<typename TreeType, bool IsSafe>

ValueAccessorBase | ( | const ValueAccessorBase< TreeType, IsSafe > & | other | ) |
| inline

Copy constructor - if IsSafe, then the copy also registers itself against the tree it is accessing.

## Member Function Documentation

## ◆ clear()

template<typename TreeType, bool IsSafe>

virtual void clear | ( |  | ) |
| pure virtual

Pure virtual method, clears the derived accessor.

Implemented in ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence >, ValueAccessorImpl< TreeType, IsSafe, MutexType, openvdb::make_index_sequence< CacheLevels > >, ValueAccessorImpl< TreeType, IsSafe, tbb::spin_mutex, openvdb::make_index_sequence< CacheLevels > >, ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence< L0 > >, ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence< L0, L1 > >, ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence< L0, L1, L2 > >, and ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence<> >.

## ◆ getTree()

template<typename TreeType, bool IsSafe>

TreeType * getTree | ( |  | ) | const
| 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).

## ◆ isSafe()

template<typename TreeType, bool IsSafe>

constexpr bool isSafe | ( |  | ) |
| inline static constexpr

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).

## ◆ operator=()

template<typename TreeType, bool IsSafe>

ValueAccessorBase & operator= | ( | const ValueAccessorBase< TreeType, IsSafe > & | other | ) |
| inline

## ◆ release()

template<typename TreeType, bool IsSafe>

virtual void release | ( |  | ) |
| inline protected virtual

Reimplemented in ValueAccessorImpl< _TreeType, IsSafe, MutexT, IntegerSequence >, ValueAccessorImpl< TreeType, IsSafe, MutexType, openvdb::make_index_sequence< CacheLevels > >, ValueAccessorImpl< TreeType, IsSafe, tbb::spin_mutex, openvdb::make_index_sequence< CacheLevels > >, ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence< L0 > >, ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence< L0, L1 > >, ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence< L0, L1, L2 > >, and ValueAccessorImpl< TreeType, IsSafe, void, openvdb::index_sequence<> >.

## ◆ tree()

template<typename TreeType, bool IsSafe>

TreeType & tree | ( |  | ) | const
| inline

Return a reference to the tree associated with this accessor.

## Friends And Related Symbol Documentation

## ◆ Tree

template<typename TreeType, bool IsSafe>
template<typename>

friend class Tree
| friend

## Member Data Documentation

## ◆ IsConstTree

template<typename TreeType, bool IsSafe>

bool IsConstTree = std::is_const<TreeType>::value
| static constexpr

Returns true if this accessor is operating on a const tree type.

## ◆ mTree

template<typename TreeType, bool IsSafe>

TreeType* mTree
| protected