dune-typetree  2.4.0-rc1
Classes | Public Types | Static Public Attributes | List of all members
Dune::TypeTree::FilteredCompositeNode< Node, Filter > Class Template Reference

Base class for composite nodes representing a filtered view on an underlying composite node. More...

#include <dune/typetree/filteredcompositenode.hh>

Classes

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

Public Types

typedef CompositeNodeTag NodeTag
 The type tag that describes a CompositeNode. More...
 
typedef mapped_children::NodeStorage NodeStorage
 The type used for storing the children. More...
 
typedef mapped_children::ChildTypes ChildTypes
 A tuple storing the types of all children. More...
 

Public Member Functions

Child Access
template<std::size_t k>
enable_if< lazy_enable< k >::value, typename Child< k >::Type & >::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>
enable_if< lazy_enable< k >::value, typename Child< k >::Storage >::type 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, typename enable_if< lazy_enable< k >::value, void * >::type=0)
 Sets the i-th child to the passed-in value. More...
 
template<std::size_t k>
void setChild (typename Child< k >::storage_type child, typename enable_if< lazy_enable< k >::value, void * >::type=0)
 Sets the storage of the i-th child to the passed-in value. More...
 
Constructors
 FilteredCompositeNode (std::shared_ptr< Node > node)
 Initialize the CompositeNode with copies of the passed in Storage objects. More...
 
 FilteredCompositeNode (Node &node)
 Initialize the CompositeNode with a copy of the passed-in storage type. More...
 

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 = filter_result::size
 The number of children. More...
 

Protected Member Functions

Access to unfiltered node
template<bool enabled = !nodeIsConst>
enable_if< enabled, Node & >::type unfiltered ()
 Returns the unfiltered node. More...
 
const Node & unfiltered () const
 Returns the unfiltered node (const version). More...
 
template<bool enabled = !nodeIsConst>
enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage ()
 Returns the storage object of the unfiltered node. More...
 
std::shared_ptr< const Node > unfilteredStorage () const
 Returns the storage object of the unfiltered node (const version). More...
 

Detailed Description

template<typename Node, typename Filter>
class Dune::TypeTree::FilteredCompositeNode< Node, Filter >

Base class for composite nodes representing a filtered view on an underlying composite node.

Member Typedef Documentation

template<typename Node , typename Filter >
typedef mapped_children::ChildTypes Dune::TypeTree::FilteredCompositeNode< Node, Filter >::ChildTypes

A tuple storing the types of all children.

template<typename Node , typename Filter >
typedef mapped_children::NodeStorage Dune::TypeTree::FilteredCompositeNode< Node, Filter >::NodeStorage

The type used for storing the children.

template<typename Node , typename Filter >
typedef CompositeNodeTag Dune::TypeTree::FilteredCompositeNode< Node, Filter >::NodeTag

The type tag that describes a CompositeNode.

Constructor & Destructor Documentation

template<typename Node , typename Filter >
Dune::TypeTree::FilteredCompositeNode< Node, Filter >::FilteredCompositeNode ( std::shared_ptr< Node >  node)
inline

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

template<typename Node , typename Filter >
Dune::TypeTree::FilteredCompositeNode< Node, Filter >::FilteredCompositeNode ( Node &  node)
inline

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

Member Function Documentation

template<typename Node , typename Filter >
template<std::size_t k>
enable_if<lazy_enable<k>::value,typename Child<k>::Type&>::type Dune::TypeTree::FilteredCompositeNode< Node, Filter >::child ( )
inline

Returns the i-th child.

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

Returns the i-th child (const version).

Returns
a const reference to the i-th child.
template<typename Node , typename Filter >
template<std::size_t k>
enable_if<lazy_enable<k>::value,typename Child<k>::Storage>::type Dune::TypeTree::FilteredCompositeNode< Node, Filter >::childStorage ( )
inline

Returns the storage of the i-th child.

Returns
a copy of the object storing the i-th child.
template<typename Node , typename Filter >
template<std::size_t k>
Child<k>::ConstStorage Dune::TypeTree::FilteredCompositeNode< Node, Filter >::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 Node , typename Filter >
template<std::size_t k>
void Dune::TypeTree::FilteredCompositeNode< Node, Filter >::setChild ( typename Child< k >::type &  child,
typename enable_if< lazy_enable< k >::value, void * >::type  = 0 
)
inline

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

template<typename Node , typename Filter >
template<std::size_t k>
void Dune::TypeTree::FilteredCompositeNode< Node, Filter >::setChild ( typename Child< k >::storage_type  child,
typename enable_if< lazy_enable< k >::value, void * >::type  = 0 
)
inline

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

template<typename Node , typename Filter >
template<bool enabled = !nodeIsConst>
enable_if<enabled,Node&>::type Dune::TypeTree::FilteredCompositeNode< Node, Filter >::unfiltered ( )
inlineprotected

Returns the unfiltered node.

Returns
A reference to the original, unfiltered node.
template<typename Node , typename Filter >
const Node& Dune::TypeTree::FilteredCompositeNode< Node, Filter >::unfiltered ( ) const
inlineprotected

Returns the unfiltered node (const version).

Returns
A const reference to the original, unfiltered node.
template<typename Node , typename Filter >
template<bool enabled = !nodeIsConst>
enable_if<enabled,std::shared_ptr<Node> >::type Dune::TypeTree::FilteredCompositeNode< Node, Filter >::unfilteredStorage ( )
inlineprotected

Returns the storage object of the unfiltered node.

Returns
A shared_ptr to the original, unfiltered node.
template<typename Node , typename Filter >
std::shared_ptr<const Node> Dune::TypeTree::FilteredCompositeNode< Node, Filter >::unfilteredStorage ( ) const
inlineprotected

Returns the storage object of the unfiltered node (const version).

Returns
A shared_ptr to the original, unfiltered node.

Member Data Documentation

template<typename Node , typename Filter >
const std::size_t Dune::TypeTree::FilteredCompositeNode< Node, Filter >::CHILDREN = filter_result::size
static

The number of children.

template<typename Node , typename Filter >
const bool Dune::TypeTree::FilteredCompositeNode< Node, Filter >::isComposite = true
static

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

template<typename Node , typename Filter >
const bool Dune::TypeTree::FilteredCompositeNode< Node, Filter >::isLeaf = false
static

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

template<typename Node , typename Filter >
const bool Dune::TypeTree::FilteredCompositeNode< Node, Filter >::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: