dune-typetree  2.3.1
Classes | Public Types | Static Public Attributes | List of all members
Dune::TypeTree::VariadicCompositeNode< Children > Class Template Reference

Base class for composite nodes based on variadic templates. More...

#include <dune/typetree/variadiccompositenode.hh>

Classes

struct  Child
 Access to the type and storage type of the i-th child. More...
 

Public Types

typedef VariadicCompositeNodeTag NodeTag
 The type tag that describes a VariadicCompositeNode. More...
 
typedef tuple< shared_ptr
< Children >... > 
NodeStorage
 The type used for storing the children. More...
 
typedef tuple< Children...> ChildTypes
 A tuple storing the types of all children. More...
 

Public Member Functions

Child Access
template<std::size_t k>
Child< k >::Type & child ()
 Returns the i-th child. More...
 
template<std::size_t k>
const Child< k >::Type & child () const
 Returns the i-th child (const version). More...
 
template<std::size_t k>
Child< k >::Storage childStorage ()
 Returns the storage of the i-th child. More...
 
template<std::size_t k>
Child< k >::ConstStorage childStorage () const
 Returns the storage of the i-th child (const version). More...
 
template<std::size_t k>
void setChild (typename Child< k >::Type &child)
 Sets the i-th child to the passed-in value. More...
 
template<std::size_t k>
void setChild (typename Child< k >::Storage child)
 Sets the storage of the i-th child to the passed-in value. More...
 
const NodeStoragenodeStorage () const
 

Static Public Attributes

static const bool isLeaf = false
 Mark this class as non leaf in the dune-typetree. More...
 
static const bool isPower = false
 Mark this class as a non power in the dune-typetree. More...
 
static const bool isComposite = true
 Mark this class as a composite in the dune-typetree. More...
 
static const std::size_t CHILDREN = sizeof...(Children)
 The number of children. More...
 

Protected Member Functions

Constructors
 VariadicCompositeNode ()
 Default constructor. More...
 
 VariadicCompositeNode (Children &...children)
 
 VariadicCompositeNode (shared_ptr< Children >...children)
 Initialize the VariadicCompositeNode with copies of the passed in Storage objects. More...
 
 VariadicCompositeNode (const NodeStorage &children)
 Initialize the VariadicCompositeNode with a copy of the passed-in storage type. More...
 

Detailed Description

template<typename... Children>
class Dune::TypeTree::VariadicCompositeNode< Children >

Base class for composite nodes based on variadic templates.

Member Typedef Documentation

template<typename... Children>
typedef tuple<Children...> Dune::TypeTree::VariadicCompositeNode< Children >::ChildTypes

A tuple storing the types of all children.

template<typename... Children>
typedef tuple<shared_ptr<Children>... > Dune::TypeTree::VariadicCompositeNode< Children >::NodeStorage

The type used for storing the children.

template<typename... Children>
typedef VariadicCompositeNodeTag Dune::TypeTree::VariadicCompositeNode< Children >::NodeTag

The type tag that describes a VariadicCompositeNode.

Constructor & Destructor Documentation

template<typename... Children>
Dune::TypeTree::VariadicCompositeNode< Children >::VariadicCompositeNode ( )
inlineprotected

Default constructor.

This constructor requires the storage type to be default constructible.

Warning
If the storage type is a pointer, the resulting object will not be usable before its children are set using any of the setChild(...) methods!
template<typename... Children>
Dune::TypeTree::VariadicCompositeNode< Children >::VariadicCompositeNode ( Children &...  children)
inlineprotected
template<typename... Children>
Dune::TypeTree::VariadicCompositeNode< Children >::VariadicCompositeNode ( shared_ptr< Children >...  children)
inlineprotected

Initialize the VariadicCompositeNode with copies of the passed in Storage objects.

template<typename... Children>
Dune::TypeTree::VariadicCompositeNode< Children >::VariadicCompositeNode ( const NodeStorage children)
inlineprotected

Initialize the VariadicCompositeNode with a copy of the passed-in storage type.

Member Function Documentation

template<typename... Children>
template<std::size_t k>
Child<k>::Type& Dune::TypeTree::VariadicCompositeNode< Children >::child ( )
inline

Returns the i-th child.

Returns
a reference to the i-th child.
template<typename... Children>
template<std::size_t k>
const Child<k>::Type& Dune::TypeTree::VariadicCompositeNode< Children >::child ( ) const
inline

Returns the i-th child (const version).

Returns
a const reference to the i-th child.
template<typename... Children>
template<std::size_t k>
Child<k>::Storage Dune::TypeTree::VariadicCompositeNode< Children >::childStorage ( )
inline

Returns the storage of the i-th child.

Returns
a copy of the object storing the i-th child.
template<typename... Children>
template<std::size_t k>
Child<k>::ConstStorage Dune::TypeTree::VariadicCompositeNode< Children >::childStorage ( ) const
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.
template<typename... Children>
const NodeStorage& Dune::TypeTree::VariadicCompositeNode< Children >::nodeStorage ( ) const
inline
template<typename... Children>
template<std::size_t k>
void Dune::TypeTree::VariadicCompositeNode< Children >::setChild ( typename Child< k >::Type &  child)
inline

Sets the i-th child to the passed-in value.

template<typename... Children>
template<std::size_t k>
void Dune::TypeTree::VariadicCompositeNode< Children >::setChild ( typename Child< k >::Storage  child)
inline

Sets the storage of the i-th child to the passed-in value.

Member Data Documentation

template<typename... Children>
const std::size_t Dune::TypeTree::VariadicCompositeNode< Children >::CHILDREN = sizeof...(Children)
static

The number of children.

template<typename... Children>
const bool Dune::TypeTree::VariadicCompositeNode< Children >::isComposite = true
static

Mark this class as a composite in the dune-typetree.

template<typename... Children>
const bool Dune::TypeTree::VariadicCompositeNode< Children >::isLeaf = false
static

Mark this class as non leaf in the dune-typetree.

template<typename... Children>
const bool Dune::TypeTree::VariadicCompositeNode< Children >::isPower = false
static

Mark this class as a non power in the dune-typetree.


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