www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
ExpressionBuilder::EBFunction Class Reference

User facing host object for a function. This combines a term with an argument list. More...

#include <ExpressionBuilder.h>

Public Member Functions

 EBFunction ()
 
 operator EBTerm () const
 cast an EBFunction into an EBTerm More...
 
 operator std::string () const
 cast into a string (via the cast into a term above) More...
 
std::string args ()
 get the list of arguments and check if they are all symbols More...
 
unsigned int substitute (const EBSubstitutionRule &rule)
 
unsigned int substitute (const EBSubstitutionRuleList &rules)
 
EBFunctionoperator() (const EBTerm &arg)
 
EBFunctionoperator() (const EBTermList &args)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3, const EBTerm &a4)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3, const EBTerm &a4, const EBTerm &a5)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3, const EBTerm &a4, const EBTerm &a5, const EBTerm &a6)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3, const EBTerm &a4, const EBTerm &a5, const EBTerm &a6, const EBTerm &a7)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3, const EBTerm &a4, const EBTerm &a5, const EBTerm &a6, const EBTerm &a7, const EBTerm &a8)
 
EBFunctionoperator() (const EBTerm &a1, const EBTerm &a2, const EBTerm &a3, const EBTerm &a4, const EBTerm &a5, const EBTerm &a6, const EBTerm &a7, const EBTerm &a8, const EBTerm &a9)
 
EBFunctionoperator= (const EBTerm &)
 
EBFunctionoperator= (const EBFunction &)
 
EBTerm operator- ()
 
EBTerm operator! ()
 

Protected Attributes

EBTermList _arguments
 argument list the function is declared with More...
 
EBTermList _eval_arguments
 argument list passed in when evaluating the function More...
 
EBTerm _term
 

Detailed Description

User facing host object for a function. This combines a term with an argument list.

Definition at line 518 of file ExpressionBuilder.h.

Constructor & Destructor Documentation

ExpressionBuilder::EBFunction::EBFunction ( )
inline

Definition at line 521 of file ExpressionBuilder.h.

521 {};

Member Function Documentation

std::string ExpressionBuilder::EBFunction::args ( )

get the list of arguments and check if they are all symbols

Definition at line 213 of file ExpressionBuilder.C.

214 {
215  unsigned int narg = _arguments.size();
216  if (narg < 1)
217  return "";
218 
219  std::ostringstream s;
220  s << _arguments[0];
221  for (unsigned int i = 1; i < narg; ++i)
222  s << ',' << _arguments[i];
223 
224  return s.str();
225 }
EBTermList _arguments
argument list the function is declared with
ExpressionBuilder::EBFunction::operator EBTerm ( ) const

cast an EBFunction into an EBTerm

ExpressionBuilder::EBFunction::operator std::string ( ) const

cast into a string (via the cast into a term above)

Definition at line 203 of file ExpressionBuilder.C.

204 {
205  EBTerm eval;
206  eval = *this; // typecast EBFunction -> EBTerm performs a parameter substitution
207  std::ostringstream s;
208  s << eval;
209  return s.str();
210 }
EBTerm ExpressionBuilder::EBFunction::operator! ( )
inline

Definition at line 612 of file ExpressionBuilder.h.

612 { return !EBTerm(*this); }
ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator() ( const EBTerm arg)

set the temporary argument list which is either used for evaluation or committed to the argument list upon function definition (assignment)

Definition at line 150 of file ExpressionBuilder.C.

151 {
152  this->_eval_arguments = {arg};
153  return *this;
154 }
EBTermList _eval_arguments
argument list passed in when evaluating the function
ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator() ( const EBTermList args)

Definition at line 157 of file ExpressionBuilder.C.

158 {
160  return *this;
161 }
EBTermList _eval_arguments
argument list passed in when evaluating the function
std::vector< EBTerm > EBTermList
std::string args()
get the list of arguments and check if they are all symbols
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2 
)
inline

convenience operators to allow single bracket syntax

Definition at line 532 of file ExpressionBuilder.h.

532 { return (*this)((a1, a2)); }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3 
)
inline

Definition at line 533 of file ExpressionBuilder.h.

534  {
535  return (*this)((a1, a2, a3));
536  }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4 
)
inline

Definition at line 538 of file ExpressionBuilder.h.

539  {
540  return (*this)((a1, a2, a3, a4));
541  }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4,
const EBTerm a5 
)
inline

Definition at line 542 of file ExpressionBuilder.h.

547  {
548  return (*this)((a1, a2, a3, a4, a5));
549  }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4,
const EBTerm a5,
const EBTerm a6 
)
inline

Definition at line 550 of file ExpressionBuilder.h.

556  {
557  return (*this)((a1, a2, a3, a4, a5, a6));
558  }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4,
const EBTerm a5,
const EBTerm a6,
const EBTerm a7 
)
inline

Definition at line 559 of file ExpressionBuilder.h.

566  {
567  return (*this)((a1, a2, a3, a4, a5, a6, a7));
568  }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4,
const EBTerm a5,
const EBTerm a6,
const EBTerm a7,
const EBTerm a8 
)
inline

Definition at line 569 of file ExpressionBuilder.h.

577  {
578  return (*this)((a1, a2, a3, a4, a5, a6, a7, a8));
579  }
EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4,
const EBTerm a5,
const EBTerm a6,
const EBTerm a7,
const EBTerm a8,
const EBTerm a9 
)
inline

Definition at line 580 of file ExpressionBuilder.h.

589  {
590  return (*this)((a1, a2, a3, a4, a5, a6, a7, a8, a9));
591  }
EBTerm ExpressionBuilder::EBFunction::operator- ( )
inline

Unary operators on functions

Definition at line 611 of file ExpressionBuilder.h.

611 { return -EBTerm(*this); }
ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator= ( const EBTerm term)

function definition (assignment)

Definition at line 164 of file ExpressionBuilder.C.

165 {
166  this->_arguments = this->_eval_arguments;
167  this->_term = term;
168  return *this;
169 }
EBTermList _eval_arguments
argument list passed in when evaluating the function
EBTermList _arguments
argument list the function is declared with
ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator= ( const EBFunction func)

Definition at line 172 of file ExpressionBuilder.C.

173 {
174  this->_arguments = this->_eval_arguments;
175  this->_term = EBTerm(func);
176  return *this;
177 }
EBTermList _eval_arguments
argument list passed in when evaluating the function
EBTermList _arguments
argument list the function is declared with
unsigned int ExpressionBuilder::EBFunction::substitute ( const EBSubstitutionRule rule)

Definition at line 228 of file ExpressionBuilder.C.

Referenced by RegularSolutionFreeEnergy::RegularSolutionFreeEnergy().

229 {
230  return _term.substitute(rule);
231 }
unsigned int substitute(const EBSubstitutionRule &rule)
unsigned int ExpressionBuilder::EBFunction::substitute ( const EBSubstitutionRuleList rules)

Definition at line 234 of file ExpressionBuilder.C.

235 {
236  return _term.substitute(rules);
237 }
unsigned int substitute(const EBSubstitutionRule &rule)

Member Data Documentation

EBTermList ExpressionBuilder::EBFunction::_arguments
protected

argument list the function is declared with

Definition at line 621 of file ExpressionBuilder.h.

EBTermList ExpressionBuilder::EBFunction::_eval_arguments
protected

argument list passed in when evaluating the function

Definition at line 623 of file ExpressionBuilder.h.

EBTerm ExpressionBuilder::EBFunction::_term
protected

Definition at line 626 of file ExpressionBuilder.h.


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