FreePOOMA  2.4.1
Public Types | Static Public Member Functions
CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > > Struct Template Reference

CreateLeaf is an external functor class used to convert objects into the leaves of the expression tree. More...

#include <FieldCreateLeaf.h>

List of all members.

Public Types

typedef Field< GeometryTag, T,
ExpressionTag< Expr > > 
Input_t
typedef Expr Leaf_t
typedef const Leaf_tReturn_t

Static Public Member Functions

static Return_t make (const Input_t &f)

Detailed Description

template<class GeometryTag, class T, class Expr>
struct CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >

CreateLeaf is an external functor class used to convert objects into the leaves of the expression tree.

CreateLeaf<T> converts objects of type T to leaf objects and requires the following interface:

Return_t should equivalent to Leaf_t. (Leaf_t needs to be able be constructed with a Return_t.) We avoid making extra copies by building expression trees from references, so define Return_t to be a const ref to an Leaf_t. (Returning by value would be bad, since we would create a temporary copy that won't survive until the whole expression is put together.)

CreateLeaf is used to construct expression trees. It should also be used when performing operations on the expression tree, such as forEach, in order to extract the expression. For example:

 template<class G, class T, class E>
 void func(const Field<G,T,E>& f)
 {
   forEach(CreateLeaf<Field<G,T,E >::make(f),...,...);
 }
 

Member Typedef Documentation

template<class GeometryTag , class T , class Expr >
typedef Field<GeometryTag, T, ExpressionTag<Expr> > CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::Input_t
template<class GeometryTag , class T , class Expr >
typedef Expr CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::Leaf_t
template<class GeometryTag , class T , class Expr >
typedef const Leaf_t& CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::Return_t

Member Function Documentation

template<class GeometryTag , class T , class Expr >
static Return_t CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::make ( const Input_t f) [inline, static]

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