Hierarchical.h¶
Note
The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.
-
class
Hierarchical
¶ 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.
-
Hierarchical
(T &self)¶ Constructor
-
std::size_t
depth
() const¶ 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.
-
bool
has_parent
() const¶ Check if the object has a parent.
- Returns
- bool
- The return value is true iff the object has a parent.
-
bool
has_child
() const¶ Check if the object has a child.
- Returns
- bool
- The return value is true iff the object has a child.
-
T &
parent
()¶ Return parent in hierarchy. An error is thrown if the object has no parent.
- Returns
- _Object_
- The parent object.
-
const T &
parent
() const¶ Return parent in hierarchy (const version).
Return shared pointer to parent. A zero pointer is returned if the object has no parent.
- Returns
- shared_ptr<T>
- The parent object.
Return shared pointer to parent (const version).
-
T &
child
()¶ Return child in hierarchy. An error is thrown if the object has no child.
- Returns
- _T_
- The child object.
-
const T &
child
() const¶ Return child in hierarchy (const version).
Return shared pointer to child. A zero pointer is returned if the object has no child.
- Returns
- shared_ptr<T>
- The child object.
Return shared pointer to child (const version).
-
T &
root_node
()¶ Return root node object in hierarchy.
- Returns
- _T_
- The root node object.
-
const T &
root_node
() const¶ Return root node object in hierarchy (const version).
Return shared pointer to root node object in hierarchy.
- Returns
- _T_
- The root node object.
Return shared pointer to root node object in hierarchy (const version).
-
T &
leaf_node
()¶ Return leaf node object in hierarchy.
- Returns
- _T_
- The leaf node object.
-
const T &
leaf_node
() const¶ Return leaf node object in hierarchy (const version).
Return shared pointer to leaf node object in hierarchy.
- Returns
- _T_
- The leaf node object.
Return shared pointer to leaf node object in hierarchy (const version).
Set parent
-
void
clear_child
()¶ Clear child
Set child
-
const Hierarchical &
operator=
(const Hierarchical &hierarchical)¶ Assignment operator
-
void
_debug
() const¶ Function useful for debugging the hierarchy
-