DOLFIN
DOLFIN C++ interface
Public Member Functions | List of all members
dolfin::Hierarchical< T > Class Template Reference

#include <Hierarchical.h>

Inheritance diagram for dolfin::Hierarchical< T >:
Inheritance graph
[legend]

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 Hierarchicaloperator= (const Hierarchical &hierarchical)
 Assignment operator.
 
void _debug () const
 Function useful for debugging the hierarchy.
 

Detailed Description

template<typename T>
class dolfin::Hierarchical< T >

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.

Member Function Documentation

◆ child()

template<typename T>
T& dolfin::Hierarchical< T >::child ( )
inline

Return child in hierarchy. An error is thrown if the object has no child.

Returns T The child object.

◆ child_shared_ptr()

template<typename T>
std::shared_ptr<T> dolfin::Hierarchical< T >::child_shared_ptr ( )
inline

Return shared pointer to child. A zero pointer is returned if the object has no child.

Returns shared_ptr<T> The child object.

◆ depth()

template<typename T>
std::size_t dolfin::Hierarchical< T >::depth ( ) const
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.

◆ has_child()

template<typename T>
bool dolfin::Hierarchical< T >::has_child ( ) const
inline

Check if the object has a child.

Returns bool The return value is true iff the object has a child.

◆ has_parent()

template<typename T>
bool dolfin::Hierarchical< T >::has_parent ( ) const
inline

Check if the object has a parent.

Returns bool The return value is true iff the object has a parent.

◆ leaf_node()

template<typename T>
T& dolfin::Hierarchical< T >::leaf_node ( )
inline

Return leaf node object in hierarchy.

Returns T The leaf node object.

◆ leaf_node_shared_ptr()

template<typename T>
std::shared_ptr<T> dolfin::Hierarchical< T >::leaf_node_shared_ptr ( )
inline

Return shared pointer to leaf node object in hierarchy.

Returns T The leaf node object.

◆ parent()

template<typename T>
T& dolfin::Hierarchical< T >::parent ( )
inline

Return parent in hierarchy. An error is thrown if the object has no parent.

Returns Object The parent object.

◆ parent_shared_ptr()

template<typename T>
std::shared_ptr<T> dolfin::Hierarchical< T >::parent_shared_ptr ( )
inline

Return shared pointer to parent. A zero pointer is returned if the object has no parent.

Returns shared_ptr<T> The parent object.

◆ root_node()

template<typename T>
T& dolfin::Hierarchical< T >::root_node ( )
inline

Return root node object in hierarchy.

Returns T The root node object.

◆ root_node_shared_ptr()

template<typename T>
std::shared_ptr<T> dolfin::Hierarchical< T >::root_node_shared_ptr ( )
inline

Return shared pointer to root node object in hierarchy.

Returns T The root node object.


The documentation for this class was generated from the following file: