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 521 of file ExpressionBuilder.h.

Constructor & Destructor Documentation

◆ EBFunction()

ExpressionBuilder::EBFunction::EBFunction ( )
inline

Definition at line 524 of file ExpressionBuilder.h.

524 {};

Member Function Documentation

◆ args()

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

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

Definition at line 216 of file ExpressionBuilder.C.

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

◆ operator EBTerm()

ExpressionBuilder::EBFunction::operator EBTerm ( ) const

cast an EBFunction into an EBTerm

◆ operator std::string()

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

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

Definition at line 206 of file ExpressionBuilder.C.

207 {
208  EBTerm eval;
209  eval = *this; // typecast EBFunction -> EBTerm performs a parameter substitution
210  std::ostringstream s;
211  s << eval;
212  return s.str();
213 }

◆ operator!()

EBTerm ExpressionBuilder::EBFunction::operator! ( )
inline

Definition at line 615 of file ExpressionBuilder.h.

615 { return !EBTerm(*this); }

◆ operator()() [1/10]

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 153 of file ExpressionBuilder.C.

154 {
155  this->_eval_arguments = {arg};
156  return *this;
157 }
EBTermList _eval_arguments
argument list passed in when evaluating the function

◆ operator()() [2/10]

ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator() ( const EBTermList args)

Definition at line 160 of file ExpressionBuilder.C.

161 {
163  return *this;
164 }
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

◆ operator()() [3/10]

EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2 
)
inline

convenience operators to allow single bracket syntax

Definition at line 535 of file ExpressionBuilder.h.

535 { return (*this)((a1, a2)); }

◆ operator()() [4/10]

EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3 
)
inline

Definition at line 536 of file ExpressionBuilder.h.

537  {
538  return (*this)((a1, a2, a3));
539  }

◆ operator()() [5/10]

EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4 
)
inline

Definition at line 541 of file ExpressionBuilder.h.

542  {
543  return (*this)((a1, a2, a3, a4));
544  }

◆ operator()() [6/10]

EBFunction& ExpressionBuilder::EBFunction::operator() ( const EBTerm a1,
const EBTerm a2,
const EBTerm a3,
const EBTerm a4,
const EBTerm a5 
)
inline

Definition at line 545 of file ExpressionBuilder.h.

550  {
551  return (*this)((a1, a2, a3, a4, a5));
552  }

◆ operator()() [7/10]

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 553 of file ExpressionBuilder.h.

559  {
560  return (*this)((a1, a2, a3, a4, a5, a6));
561  }

◆ operator()() [8/10]

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 562 of file ExpressionBuilder.h.

569  {
570  return (*this)((a1, a2, a3, a4, a5, a6, a7));
571  }

◆ operator()() [9/10]

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 572 of file ExpressionBuilder.h.

580  {
581  return (*this)((a1, a2, a3, a4, a5, a6, a7, a8));
582  }

◆ operator()() [10/10]

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 583 of file ExpressionBuilder.h.

592  {
593  return (*this)((a1, a2, a3, a4, a5, a6, a7, a8, a9));
594  }

◆ operator-()

EBTerm ExpressionBuilder::EBFunction::operator- ( )
inline

Unary operators on functions

Definition at line 614 of file ExpressionBuilder.h.

614 { return -EBTerm(*this); }

◆ operator=() [1/2]

ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator= ( const EBTerm term)

function definition (assignment)

Definition at line 167 of file ExpressionBuilder.C.

168 {
169  this->_arguments = this->_eval_arguments;
170  this->_term = term;
171  return *this;
172 }
EBTermList _eval_arguments
argument list passed in when evaluating the function
EBTermList _arguments
argument list the function is declared with

◆ operator=() [2/2]

ExpressionBuilder::EBFunction & ExpressionBuilder::EBFunction::operator= ( const EBFunction func)

Definition at line 175 of file ExpressionBuilder.C.

176 {
177  this->_arguments = this->_eval_arguments;
178  this->_term = EBTerm(func);
179  return *this;
180 }
EBTermList _eval_arguments
argument list passed in when evaluating the function
EBTermList _arguments
argument list the function is declared with

◆ substitute() [1/2]

unsigned int ExpressionBuilder::EBFunction::substitute ( const EBSubstitutionRule rule)

Definition at line 231 of file ExpressionBuilder.C.

Referenced by RegularSolutionFreeEnergy::RegularSolutionFreeEnergy().

232 {
233  return _term.substitute(rule);
234 }
unsigned int substitute(const EBSubstitutionRule &rule)

◆ substitute() [2/2]

unsigned int ExpressionBuilder::EBFunction::substitute ( const EBSubstitutionRuleList rules)

Definition at line 237 of file ExpressionBuilder.C.

238 {
239  return _term.substitute(rules);
240 }
unsigned int substitute(const EBSubstitutionRule &rule)

Member Data Documentation

◆ _arguments

EBTermList ExpressionBuilder::EBFunction::_arguments
protected

argument list the function is declared with

Definition at line 624 of file ExpressionBuilder.h.

◆ _eval_arguments

EBTermList ExpressionBuilder::EBFunction::_eval_arguments
protected

argument list passed in when evaluating the function

Definition at line 626 of file ExpressionBuilder.h.

◆ _term

EBTerm ExpressionBuilder::EBFunction::_term
protected

Definition at line 629 of file ExpressionBuilder.h.


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