|
dune-typetree 2.12-git
|
Collect multiple instances of type T within a dune-typetree. More...
#include <dune/typetree/dynamicpowernode.hh>
Public Types | |
| typedef DynamicPowerNodeTag | NodeTag |
| The type tag that describes the node. | |
| typedef T | ChildType |
| The type of each child. | |
| typedef std::shared_ptr< T > | ChildStorageType |
| The storage type of each child. | |
| typedef std::shared_ptr< const T > | ChildConstStorageType |
| The const version of the storage type of each child. | |
| typedef std::vector< ChildStorageType > | NodeStorage |
| The type used for storing the children. | |
Public Member Functions | |
| std::size_t | degree () const |
| The number of children. | |
Child Access (Dynamic methods) | |
| ChildType & | child (std::size_t i) |
| Returns the i-th child. | |
| const ChildType & | child (std::size_t i) const |
| Returns the i-th child (const version). | |
| ChildStorageType | childStorage (std::size_t i) |
| Returns the storage of the i-th child. | |
| ChildConstStorageType | childStorage (std::size_t i) const |
| Returns the storage of the i-th child (const version). | |
| void | setChild (std::size_t i, ChildType &t) |
| Sets the i-th child to the passed-in value. | |
| void | setChild (std::size_t i, ChildType &&t) |
| Store the passed value in i-th child. | |
| void | setChild (std::size_t i, ChildStorageType st) |
| Sets the stored value representing the i-th child to the passed-in value. | |
| const NodeStorage & | nodeStorage () const |
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 | |
| DynamicPowerNode ()=delete | |
| DynamicPowerNode (std::size_t size) | |
| Construct a node with the given number of children. | |
| DynamicPowerNode (NodeStorage children) | |
| Initialize the DynamicPowerNode with a copy of the passed-in storage type. | |
| DynamicPowerNode (T &t1, T &t2,...) | |
| Initialize all children with the passed-in objects. | |
Detailed Description
class Dune::TypeTree::DynamicPowerNode< T >
Collect multiple instances of type T within a dune-typetree.
- Template Parameters
-
T Type of the tree-node children
Member Typedef Documentation
◆ ChildConstStorageType
| typedef std::shared_ptr<const T> Dune::TypeTree::DynamicPowerNode< T >::ChildConstStorageType |
The const version of the storage type of each child.
◆ ChildStorageType
| typedef std::shared_ptr<T> Dune::TypeTree::DynamicPowerNode< T >::ChildStorageType |
The storage type of each child.
◆ ChildType
| typedef T Dune::TypeTree::DynamicPowerNode< T >::ChildType |
The type of each child.
◆ NodeStorage
| typedef std::vector<ChildStorageType> Dune::TypeTree::DynamicPowerNode< T >::NodeStorage |
The type used for storing the children.
◆ NodeTag
| typedef DynamicPowerNodeTag Dune::TypeTree::DynamicPowerNode< T >::NodeTag |
The type tag that describes the node.
Constructor & Destructor Documentation
◆ DynamicPowerNode() [1/4]
|
protecteddelete |
The Default constructor is deleted, since you need to pass the number of children. There is currently no dynamic resize of this node type implemented.
◆ DynamicPowerNode() [2/4]
|
inlineexplicitprotected |
Construct a node with the given number of children.
The constructor is protected, as DynamicPowerNode is a utility class that needs to be filled with meaning by subclassing it and adding useful functionality to the subclass.
- Warning
- When using this constructor, make sure to set ALL children by means of the setChild() methods!
◆ DynamicPowerNode() [3/4]
|
inlineexplicitprotected |
Initialize the DynamicPowerNode with a copy of the passed-in storage type.
◆ DynamicPowerNode() [4/4]
|
inlineprotected |
Initialize all children with the passed-in objects.
Member Function Documentation
◆ child() [1/2]
|
inline |
Returns the i-th child.
- Returns
- a reference to the i-th child.
◆ child() [2/2]
|
inline |
Returns the i-th child (const version).
- Returns
- a const reference to the i-th child.
◆ childStorage() [1/2]
|
inline |
Returns the storage of the i-th child.
- Returns
- a copy of the object storing the i-th child.
◆ childStorage() [2/2]
|
inline |
Returns the storage of the i-th child (const version).
This method is only important if the child is stored as some kind of pointer, as this allows the pointee type to become const.
- Returns
- a copy of the object storing the i-th child.
◆ degree()
|
inline |
The number of children.
◆ nodeStorage()
|
inline |
◆ setChild() [1/3]
|
inline |
Sets the stored value representing the i-th child to the passed-in value.
◆ setChild() [2/3]
|
inline |
Store the passed value in i-th child.
◆ setChild() [3/3]
|
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