|
dune-typetree 2.12-git
|
Collect k instances of type T within a dune-typetree. More...
#include <dune/typetree/powernode.hh>
Classes | |
| struct | Child |
| Access to the type and storage type of the i-th child. More... | |
Public Types | |
| typedef PowerNodeTag | NodeTag |
| The type tag that describes a PowerNode. | |
| typedef T | ChildType |
| The type of each child. | |
| typedef std::array< std::shared_ptr< T >, k > | NodeStorage |
| The type used for storing the children. | |
Public Member Functions | |
Child Access (templated methods) | |
| template<std::size_t i> | |
| T & | child (index_constant< i >={}) |
| Returns the i-th child. | |
| template<std::size_t i> | |
| const T & | child (index_constant< i >={}) const |
| Returns the i-th child (const version). | |
| template<std::size_t i> | |
| std::shared_ptr< T > | childStorage (index_constant< i >={}) |
| Returns the storage of the i-th child. | |
| template<std::size_t i> | |
| std::shared_ptr< const T > | childStorage (index_constant< i >={}) const |
| Returns the storage of the i-th child (const version). | |
| template<std::size_t i> | |
| void | setChild (T &t, index_constant< i >={}) |
| Sets the i-th child to the passed-in value. | |
| template<std::size_t i> | |
| void | setChild (T &&t, index_constant< i >={}) |
| Store the passed value in i-th child. | |
| template<std::size_t i> | |
| void | setChild (std::shared_ptr< T > st, index_constant< i >={}) |
| Sets the stored value representing the i-th child to the passed-in value. | |
Child Access (Dynamic methods) | |
| T & | child (std::size_t i) |
| Returns the i-th child. | |
| const T & | child (std::size_t i) const |
| Returns the i-th child (const version). | |
| std::shared_ptr< T > | childStorage (std::size_t i) |
| Returns the storage of the i-th child. | |
| std::shared_ptr< const T > | childStorage (std::size_t i) const |
| Returns the storage of the i-th child (const version). | |
| void | setChild (std::size_t i, T &t) |
| Sets the i-th child to the passed-in value. | |
| void | setChild (std::size_t i, T &&t) |
| Store the passed value in i-th child. | |
| void | setChild (std::size_t i, std::shared_ptr< T > st) |
| Sets the stored value representing the i-th child to the passed-in value. | |
| const NodeStorage & | nodeStorage () const |
Nested Child Access | |
| template<typename... Indices> | |
| ImplementationDefined & | child (Indices... indices) |
| Returns the child given by the list of indices. | |
| template<typename... Indices> | |
| const ImplementationDefined & | child (Indices... indices) |
| Returns the child given by the list of indices. | |
Static Public Member Functions | |
| static constexpr auto | degree () |
Static Public Attributes | |
| static const bool | isLeaf = false |
| Mark this class as non leaf in the dune-typetree. | |
| static const bool | isPower = true |
| Mark this class as a power in the dune-typetree. | |
| static const bool | isComposite = false |
| Mark this class as a non composite in the dune-typetree. | |
Protected Member Functions | |
Constructors | |
| PowerNode () | |
| Default constructor. | |
| PowerNode (const NodeStorage &children) | |
| Initialize the PowerNode with a copy of the passed-in storage type. | |
| PowerNode (T &t, bool distinct_objects=true) | |
Initialize all children with copies of a storage object constructed from the parameter t. | |
| PowerNode (T &t1, T &t2,...) | |
| Initialize all children with the passed-in objects. | |
Detailed Description
class Dune::TypeTree::PowerNode< T, k >
Collect k instances of type T within a dune-typetree.
- Template Parameters
-
T The base type k The number of instances this node should collect
Member Typedef Documentation
◆ ChildType
| typedef T Dune::TypeTree::PowerNode< T, k >::ChildType |
The type of each child.
◆ NodeStorage
| typedef std::array<std::shared_ptr<T>,k> Dune::TypeTree::PowerNode< T, k >::NodeStorage |
The type used for storing the children.
◆ NodeTag
| typedef PowerNodeTag Dune::TypeTree::PowerNode< T, k >::NodeTag |
The type tag that describes a PowerNode.
Constructor & Destructor Documentation
◆ PowerNode() [1/4]
|
inlineprotected |
Default constructor.
The default constructor is protected, as PowerNode is a utility class that needs to be filled with meaning by subclassing it and adding useful functionality to the subclass.
- Warning
- When using the default constructor, make sure to set ALL children by means of the setChild() methods!
◆ PowerNode() [2/4]
|
inlineexplicitprotected |
Initialize the PowerNode with a copy of the passed-in storage type.
◆ PowerNode() [3/4]
|
inlineexplicitprotected |
Initialize all children with copies of a storage object constructed from the parameter t.
◆ PowerNode() [4/4]
|
inlineprotected |
Initialize all children with the passed-in objects.
Member Function Documentation
◆ child() [1/6]
|
inline |
Returns the i-th child.
- Returns
- a reference to the i-th child.
◆ child() [2/6]
|
inline |
Returns the i-th child (const version).
- Returns
- a const reference to the i-th child.
◆ child() [3/6]
|
inline |
Returns the child given by the list of indices.
This method simply forwards to the freestanding function child(). See that function for further information.
◆ child() [4/6]
|
inline |
Returns the child given by the list of indices.
This method simply forwards to the freestanding function child(). See that function for further information.
◆ child() [5/6]
|
inline |
Returns the i-th child.
- Returns
- a reference to the i-th child.
◆ child() [6/6]
|
inline |
Returns the i-th child (const version).
- Returns
- a const reference to the i-th child.
◆ childStorage() [1/4]
|
inline |
Returns the storage of the i-th child.
- Returns
- a copy of the object storing the i-th child.
◆ childStorage() [2/4]
|
inline |
Returns the storage of the i-th child (const version).
- Returns
- a copy of the object storing the i-th child.
◆ childStorage() [3/4]
|
inline |
Returns the storage of the i-th child.
- Returns
- a copy of the object storing the i-th child.
◆ childStorage() [4/4]
|
inline |
Returns the storage of the i-th child (const version).
- Returns
- a copy of the object storing the i-th child.
◆ degree()
|
inlinestaticconstexpr |
◆ nodeStorage()
|
inline |
◆ setChild() [1/6]
|
inline |
Sets the stored value representing the i-th child to the passed-in value.
◆ setChild() [2/6]
|
inline |
Sets the stored value representing the i-th child to the passed-in value.
◆ setChild() [3/6]
|
inline |
Store the passed value in i-th child.
◆ setChild() [4/6]
|
inline |
Sets the i-th child to the passed-in value.
◆ setChild() [5/6]
|
inline |
Store the passed value in i-th child.
◆ setChild() [6/6]
|
inline |
Sets the i-th child to the passed-in value.
Member Data Documentation
◆ isComposite
|
static |
Mark this class as a non composite in the dune-typetree.
◆ isLeaf
|
static |
Mark this class as non leaf in the dune-typetree.
◆ isPower
|
static |
Mark this class as a power in the dune-typetree.
The documentation for this class was generated from the following file:
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8