dune-typetree 2.8.0
|
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. More... | |
typedef T | ChildType |
The type of each child. More... | |
typedef std::shared_ptr< T > | ChildStorageType |
The storage type of each child. More... | |
typedef std::shared_ptr< const T > | ChildConstStorageType |
The const version of the storage type of each child. More... | |
typedef std::vector< ChildStorageType > | NodeStorage |
The type used for storing the children. More... | |
Public Member Functions | |
std::size_t | degree () const |
The number of children. More... | |
Child Access (Dynamic methods) | |
ChildType & | child (std::size_t i) |
Returns the i-th child. More... | |
const ChildType & | child (std::size_t i) const |
Returns the i-th child (const version). More... | |
ChildStorageType | childStorage (std::size_t i) |
Returns the storage of the i-th child. More... | |
ChildConstStorageType | childStorage (std::size_t i) const |
Returns the storage of the i-th child (const version). More... | |
void | setChild (std::size_t i, ChildType &t) |
Sets the i-th child to the passed-in value. More... | |
void | setChild (std::size_t i, ChildType &&t) |
Store the passed value in i-th child. More... | |
void | setChild (std::size_t i, ChildStorageType st) |
Sets the stored value representing the i-th child to the passed-in value. More... | |
const NodeStorage & | nodeStorage () const |
Static Public Attributes | |
static const bool | isLeaf = false |
Mark this class as non leaf in the dune-typetree. More... | |
static const bool | isPower = true |
Mark this class as a power in the dune-typetree. More... | |
static const bool | isComposite = false |
Mark this class as a non composite in the dune-typetree. More... | |
Protected Member Functions | |
Constructors | |
DynamicPowerNode ()=delete | |
DynamicPowerNode (std::size_t size) | |
Construct a node with the given number of children. More... | |
DynamicPowerNode (NodeStorage children) | |
Initialize the DynamicPowerNode with a copy of the passed-in storage type. More... | |
DynamicPowerNode (T &t1, T &t2,...) | |
Initialize all children with the passed-in objects. More... | |
Collect multiple instances of type T within a dune-typetree.
T | Type of the tree-node children |
typedef std::shared_ptr<const T> Dune::TypeTree::DynamicPowerNode< T >::ChildConstStorageType |
The const version of the storage type of each child.
typedef std::shared_ptr<T> Dune::TypeTree::DynamicPowerNode< T >::ChildStorageType |
The storage type of each child.
typedef T Dune::TypeTree::DynamicPowerNode< T >::ChildType |
The type of each child.
typedef std::vector<ChildStorageType> Dune::TypeTree::DynamicPowerNode< T >::NodeStorage |
The type used for storing the children.
typedef DynamicPowerNodeTag Dune::TypeTree::DynamicPowerNode< T >::NodeTag |
The type tag that describes the node.
|
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.
|
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.
|
inlineexplicitprotected |
Initialize the DynamicPowerNode with a copy of the passed-in storage type.
|
inlineprotected |
Initialize all children with the passed-in objects.
|
inline |
Returns the i-th child.
|
inline |
Returns the i-th child (const version).
|
inline |
Returns the storage of the i-th child.
|
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.
|
inline |
The number of children.
|
inline |
|
inline |
Sets the stored value representing the i-th child to the passed-in value.
|
inline |
Store the passed value in i-th child.
|
inline |
Sets the i-th child to the passed-in value.
|
static |
Mark this class as a non composite in the dune-typetree.
|
static |
Mark this class as non leaf in the dune-typetree.
|
static |
Mark this class as a power in the dune-typetree.