te::fe::Function Class Referenceabstract

A function is a named procedure that performs a distinct computation. More...

#include <Function.h>

Inheritance diagram for te::fe::Function:
te::fe::Expression te::common::BaseVisitable< Visitor >

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...
 
ExpressiongetArgument (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 Expressionclone () 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...
 

Detailed Description

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.

See also
Expression

Definition at line 54 of file Function.h.

Member Typedef Documentation

typedef void te::common::BaseVisitable< Visitor , void >::ReturnType
inherited

Definition at line 58 of file BaseVisitable.h.

typedef Visitor te::common::BaseVisitable< Visitor , void >::VisitorType
inherited

Definition at line 57 of file BaseVisitable.h.

Constructor & Destructor Documentation

te::fe::Function::Function ( const std::string &  name)

It initializes a new Function.

Parameters
nameFunction name. Must be a non-empty value.
te::fe::Function::~Function ( )

Destructor.

Member Function Documentation

virtual ReturnType te::common::BaseVisitable< Visitor , void >::accept ( VisitorType guest) const
pure virtualinherited

It call the visit method from the guest object.

Parameters
guestThe guest or visitor.
Returns
Any valid value define by the template type R.
void te::fe::Function::add ( Expression argument)

It adds a new argument to the function.

Parameters
argumentThe argument to be added. The Function object will take the ownership of the given argument.
virtual Expression* te::fe::Function::clone ( ) const
virtual

It returns a clone of this object.

Returns
A clone of this object.

Implements te::fe::Expression.

Expression* te::fe::Function::getArgument ( size_t  i) const

It returns the argument in the specified position.

Parameters
iThe argument index.
Returns
The argument in the specified position.
Note
The argument index start at 0.
It doesn't check the index range.
const std::string& te::fe::Function::getName ( ) const

It returns the function name.

Returns
The function name.
void te::fe::Function::removeArgument ( size_t  i)

It removes the n-th argument.

Parameters
iThe argument index.
Note
It doesn't check the index range.
void te::fe::Function::setArgument ( size_t  i,
Expression argument 
)

It sets the argument in the specified position.

Parameters
iThe argument index.
argumentThe new argument. The Function object will take the ownership of the given argument.
Note
The argument index start at 0.
Be sure that the argument list is already defined having the location you are specifying.
It doesn't check the index range.
void te::fe::Function::setName ( const std::string &  n)

It sets the function name.

Parameters
nThe function name.

Member Data Documentation

std::vector<Expression*> te::fe::Function::m_argumentList
protected

Argument list (actually, a list of expressions). (Optional)

Definition at line 154 of file Function.h.

std::string te::fe::Function::m_name
protected

Function name. (Mandatory)

Definition at line 153 of file Function.h.


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