FreePOOMA
2.4.1
|
CreateLeaf is an external functor class used to convert objects into the leaves of the expression tree. More...
#include <FieldCreateLeaf.h>
Public Types | |
typedef Field< GeometryTag, T, ExpressionTag< Expr > > | Input_t |
typedef Expr | Leaf_t |
typedef const Leaf_t & | Return_t |
Static Public Member Functions | |
static Return_t | make (const Input_t &f) |
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),...,...); }
typedef Field<GeometryTag, T, ExpressionTag<Expr> > CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::Input_t |
typedef Expr CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::Leaf_t |
typedef const Leaf_t& CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::Return_t |
static Return_t CreateLeaf< Field< GeometryTag, T, ExpressionTag< Expr > > >::make | ( | const Input_t & | f | ) | [inline, static] |
References Field< Mesh, T, EngineTag >::engine().