DOLFIN
DOLFIN C++ interface
|
#include <Hierarchical.h>
Public Member Functions | |
Hierarchical (T &self) | |
Constructor. | |
virtual | ~Hierarchical () |
Destructor. | |
std::size_t | depth () const |
bool | has_parent () const |
bool | has_child () const |
T & | parent () |
const T & | parent () const |
Return parent in hierarchy (const version). | |
std::shared_ptr< T > | parent_shared_ptr () |
std::shared_ptr< const T > | parent_shared_ptr () const |
Return shared pointer to parent (const version). | |
T & | child () |
const T & | child () const |
Return child in hierarchy (const version). | |
std::shared_ptr< T > | child_shared_ptr () |
std::shared_ptr< const T > | child_shared_ptr () const |
Return shared pointer to child (const version). | |
T & | root_node () |
const T & | root_node () const |
Return root node object in hierarchy (const version). | |
std::shared_ptr< T > | root_node_shared_ptr () |
std::shared_ptr< const T > | root_node_shared_ptr () const |
Return shared pointer to root node object in hierarchy (const version). | |
T & | leaf_node () |
const T & | leaf_node () const |
Return leaf node object in hierarchy (const version). | |
std::shared_ptr< T > | leaf_node_shared_ptr () |
std::shared_ptr< const T > | leaf_node_shared_ptr () const |
Return shared pointer to leaf node object in hierarchy (const version). | |
void | set_parent (std::shared_ptr< T > parent) |
Set parent. | |
void | clear_child () |
Clear child. | |
void | set_child (std::shared_ptr< T > child) |
Set child. | |
const Hierarchical & | operator= (const Hierarchical &hierarchical) |
Assignment operator. | |
void | _debug () const |
Function useful for debugging the hierarchy. | |
This class provides storage and data access for hierarchical classes; that is, classes where an object may have a child and a parent.
Note to developers: each subclass of Hierarchical that implements an assignment operator must call the base class assignment operator at the end of the subclass assignment operator. See the Mesh class for an example.
|
inline |
Return child in hierarchy. An error is thrown if the object has no child.
Returns T The child object.
|
inline |
Return shared pointer to child. A zero pointer is returned if the object has no child.
Returns shared_ptr<T> The child object.
|
inline |
Return depth of the hierarchy; that is, the total number of objects in the hierarchy linked to the current object via child-parent relationships, including the object itself.
Returns std::size_t The depth of the hierarchy.
|
inline |
Check if the object has a child.
Returns bool The return value is true iff the object has a child.
|
inline |
Check if the object has a parent.
Returns bool The return value is true iff the object has a parent.
|
inline |
Return leaf node object in hierarchy.
Returns T The leaf node object.
|
inline |
Return shared pointer to leaf node object in hierarchy.
Returns T The leaf node object.
|
inline |
Return parent in hierarchy. An error is thrown if the object has no parent.
Returns Object The parent object.
|
inline |
Return shared pointer to parent. A zero pointer is returned if the object has no parent.
Returns shared_ptr<T> The parent object.
|
inline |
Return root node object in hierarchy.
Returns T The root node object.
|
inline |
Return shared pointer to root node object in hierarchy.
Returns T The root node object.