LifeV
ExpressionFunctor1< FunctorType, ArgumentType > Class Template Reference

class ExpressionFunctor1 Class representing a functor with 1 expression as arguement. More...

#include <ExpressionFunctor.hpp>

+ Inheritance diagram for ExpressionFunctor1< FunctorType, ArgumentType >:
+ Collaboration diagram for ExpressionFunctor1< FunctorType, ArgumentType >:

Private Attributes

std::shared_ptr< FunctorType > M_functor
 
ArgumentType M_argument
 

Public Types

typedef ExpressionBase< ExpressionFunctor1< FunctorType, ArgumentType > > base_Type
 

Constructors & Destructor

 ExpressionFunctor1 (std::shared_ptr< FunctorType > fct, const ArgumentType &arg)
 Argument with the required data in argument. More...
 
 ExpressionFunctor1 (const ExpressionFunctor1< FunctorType, ArgumentType > &expr)
 Copy constructor. More...
 
 ~ExpressionFunctor1 ()
 Destructor. More...
 

Methods

static void display (std::ostream &out=std::cout)
 Display method. More...
 

Get Methods

std::shared_ptr< FunctorType > functor () const
 Getter for the functor. More...
 
const ArgumentType & argument () const
 Getter for the expression to be placed as argument. More...
 

Private Methods

 ExpressionFunctor1 ()
 No empty constructor. More...
 

Additional Inherited Members

- Public Types inherited from ExpressionBase< ExpressionFunctor1< FunctorType, ArgumentType > >
typedef ExpressionFunctor1< FunctorType, ArgumentType > derived_Type
 
- Public Member Functions inherited from ExpressionBase< ExpressionFunctor1< FunctorType, ArgumentType > >
 ExpressionBase ()
 Empty and only constructor. More...
 
virtual ~ExpressionBase ()
 Destructor. More...
 
const derived_Typecast () const
 Method to cast away the type and get the real (DerivedType) object. More...
 

Detailed Description

template<typename FunctorType, typename ArgumentType>
class LifeV::ExpressionAssembly::ExpressionFunctor1< FunctorType, ArgumentType >

class ExpressionFunctor1 Class representing a functor with 1 expression as arguement.

Author
Samuel Quinodoz samue.nosp@m.l.qu.nosp@m.inodo.nosp@m.z@ep.nosp@m.fl.ch

This expression is usefull to build expressions that are "function-like": In case one wants to have an expression that is a function, the functor passed to this expression will have no members and its operator() will operate the function evaluation.

A functor, however, is more general in the sense that it can contain data. These data can be very simple (e.g. just a Real to represent the current time for a function that would depend on time as well) or arbitrarily complicated.

It is required to pass the functor as a shared pointer in order to avoid the copy of heavy data that could be stored in the functor.

Template parameters

FunctorType: The type of the functor

ArgumentType: The type of the argument, that is an expression (it is usually different from the input type expected by the functor)

Template requirements

FunctorType: None

ArgumentType: Copiable, has a static method for display

Definition at line 87 of file ExpressionFunctor.hpp.

Member Typedef Documentation

◆ base_Type

typedef ExpressionBase<ExpressionFunctor1<FunctorType, ArgumentType> > base_Type

Definition at line 95 of file ExpressionFunctor.hpp.

Constructor & Destructor Documentation

◆ ExpressionFunctor1() [1/3]

ExpressionFunctor1 ( std::shared_ptr< FunctorType >  fct,
const ArgumentType &  arg 
)
inline

Argument with the required data in argument.

Definition at line 104 of file ExpressionFunctor.hpp.

◆ ExpressionFunctor1() [2/3]

ExpressionFunctor1 ( const ExpressionFunctor1< FunctorType, ArgumentType > &  expr)
inline

Copy constructor.

Definition at line 111 of file ExpressionFunctor.hpp.

◆ ~ExpressionFunctor1()

~ExpressionFunctor1 ( )
inline

Destructor.

Definition at line 118 of file ExpressionFunctor.hpp.

◆ ExpressionFunctor1() [3/3]

ExpressionFunctor1 ( )
private

No empty constructor.

Member Function Documentation

◆ display()

static void display ( std::ostream &  out = std::cout)
inlinestatic

Display method.

Definition at line 127 of file ExpressionFunctor.hpp.

◆ functor()

std::shared_ptr<FunctorType> functor ( ) const
inline

Getter for the functor.

Definition at line 141 of file ExpressionFunctor.hpp.

◆ argument()

const ArgumentType& argument ( ) const
inline

Getter for the expression to be placed as argument.

Definition at line 147 of file ExpressionFunctor.hpp.

Field Documentation

◆ M_functor

std::shared_ptr<FunctorType> M_functor
private

Definition at line 165 of file ExpressionFunctor.hpp.

◆ M_argument

ArgumentType M_argument
private

Definition at line 168 of file ExpressionFunctor.hpp.


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