A function is a named procedure that performs a distinct computation. More...
#include <Function.h>
Public Types | |
typedef void | ReturnType |
typedef Visitor | VisitorType |
Public Member Functions | |
virtual ReturnType | accept (VisitorType &guest) const =0 |
It call the visit method from the guest object. More... | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
Function (const std::string &name) | |
It initializes a new Function. More... | |
~Function () | |
Destructor. More... | |
Accessor methods | |
Methods used to get or set properties. | |
const std::string & | getName () const |
It returns the function name. More... | |
void | setName (const std::string &n) |
It sets the function name. More... | |
Expression * | getArgument (size_t i) const |
It returns the argument in the specified position. More... | |
void | add (Expression *argument) |
It adds a new argument to the function. More... | |
void | setArgument (size_t i, Expression *argument) |
It sets the argument in the specified position. More... | |
void | removeArgument (size_t i) |
It removes the n-th argument. More... | |
Expression Re-implementation | |
Methods re-implemented from Expression. | |
virtual Expression * | clone () const |
It returns a clone of this object. More... | |
Protected Attributes | |
std::vector< Expression * > | m_argumentList |
Argument list (actually, a list of expressions). (Optional) More... | |
std::string | m_name |
Function name. (Mandatory) More... | |
A function is a named procedure that performs a distinct computation.
A function may accept zero or more arguments as input and generates a single result.
Definition at line 54 of file Function.h.
|
inherited |
Definition at line 58 of file BaseVisitable.h.
|
inherited |
Definition at line 57 of file BaseVisitable.h.
te::fe::Function::Function | ( | const std::string & | name | ) |
te::fe::Function::~Function | ( | ) |
Destructor.
|
pure virtualinherited |
It call the visit method from the guest object.
guest | The guest or visitor. |
void te::fe::Function::add | ( | Expression * | argument | ) |
It adds a new argument to the function.
argument | The argument to be added. The Function object will take the ownership of the given argument. |
|
virtual |
Expression* te::fe::Function::getArgument | ( | size_t | i | ) | const |
It returns the argument in the specified position.
i | The argument index. |
const std::string& te::fe::Function::getName | ( | ) | const |
It returns the function name.
void te::fe::Function::removeArgument | ( | size_t | i | ) |
It removes the n-th argument.
i | The argument index. |
void te::fe::Function::setArgument | ( | size_t | i, |
Expression * | argument | ||
) |
It sets the argument in the specified position.
i | The argument index. |
argument | The new argument. The Function object will take the ownership of the given argument. |
void te::fe::Function::setName | ( | const std::string & | n | ) |
It sets the function name.
n | The function name. |
|
protected |
Argument list (actually, a list of expressions). (Optional)
Definition at line 154 of file Function.h.
|
protected |
Function name. (Mandatory)
Definition at line 153 of file Function.h.