te::da::FunctionDefn Class Reference

The definition of a function that can be used in a query object. More...

#include <FunctionDefn.h>

Inheritance diagram for te::da::FunctionDefn:

Public Member Functions

void add (FunctionParameter *p)
 It adds the parameter to the function list of parameters. More...
 
 FunctionDefn (const std::string &name, int retValType=te::dt::VOID_TYPE, bool isAggregate=false, std::string *description=0)
 Constructor. More...
 
std::string * getDescription () const
 It returns a brief description about the function. More...
 
const std::string & getName () const
 It returns the function name. More...
 
std::size_t getNumParams () const
 It returns the number of parameters for the function. More...
 
int getRetValType () const
 It returns the data type of the return value. More...
 
bool isAggregate () const
 It returns true if it is an aggregate function, otherwise, returns false. More...
 
FunctionParameteroperator[] (std::size_t i) const
 It returns the i-th function parameter. More...
 
void setDescription (std::string *description)
 It sets a brief description about the function. More...
 
void SetIsAggregate (bool a)
 It tells if the function is an aggregate function or not. More...
 
void setName (const std::string &name)
 It sets the function name;. More...
 
void setRetValType (int r)
 It sets the data type of the return value. More...
 
 ~FunctionDefn ()
 Destructor. More...
 

Protected Attributes

std::string * m_description
 A brief description of the function. More...
 
bool m_isAggregate
 A flag that defines if the function is an aggregate one. More...
 
std::string m_name
 The function name. It may be an operator symbol or just a regular name like st_intersects. More...
 
std::vector< FunctionParameter * > m_params
 The list of arguments. More...
 
int m_retValType
 Data type of the return value. More...
 

Detailed Description

The definition of a function that can be used in a query object.

All functions must have a name in lower case letters.

See also
FunctionCatalog, FunctionCatalogManager, FunctionParameter

Definition at line 56 of file FunctionDefn.h.

Constructor & Destructor Documentation

te::da::FunctionDefn::FunctionDefn ( const std::string &  name,
int  retValType = te::dt::VOID_TYPE,
bool  isAggregate = false,
std::string *  description = 0 
)

Constructor.

Parameters
nameThe function name.
retValTypeThe return value type (void by default).
isAggregateTells if function is an aggregate function (false by default).
descriptionA brief description about the function (NULL by default). The FunctionDefn will take the ownership of the given description.
te::da::FunctionDefn::~FunctionDefn ( )

Destructor.

Member Function Documentation

void te::da::FunctionDefn::add ( FunctionParameter p)
inline

It adds the parameter to the function list of parameters.

Parameters
pThe parameter to be added.
Note
The FunctionDefn will take the ownership of the given parameter.

Definition at line 159 of file FunctionDefn.h.

std::string* te::da::FunctionDefn::getDescription ( ) const
inline

It returns a brief description about the function.

Returns
A brief description about the function or NULL if none is provide.

Definition at line 125 of file FunctionDefn.h.

const std::string& te::da::FunctionDefn::getName ( ) const
inline

It returns the function name.

Returns
The function name.

Definition at line 81 of file FunctionDefn.h.

std::size_t te::da::FunctionDefn::getNumParams ( ) const
inline

It returns the number of parameters for the function.

Returns
The number of parameters.

Definition at line 139 of file FunctionDefn.h.

int te::da::FunctionDefn::getRetValType ( ) const
inline

It returns the data type of the return value.

Returns
The data type of the return value.

Definition at line 97 of file FunctionDefn.h.

bool te::da::FunctionDefn::isAggregate ( ) const
inline

It returns true if it is an aggregate function, otherwise, returns false.

Returns
True if it is an aggregate function, otherwise, returns false.

Definition at line 111 of file FunctionDefn.h.

FunctionParameter* te::da::FunctionDefn::operator[] ( std::size_t  i) const
inline

It returns the i-th function parameter.

Parameters
iThe parameter position.
Returns
The i-th function parameter.
Note
It will not check the index range.

Definition at line 150 of file FunctionDefn.h.

void te::da::FunctionDefn::setDescription ( std::string *  description)

It sets a brief description about the function.

Parameters
descriptionA brief description about the function. The FunctionDefn will take the ownership of the given description.
void te::da::FunctionDefn::SetIsAggregate ( bool  a)
inline

It tells if the function is an aggregate function or not.

Parameters
aIf true the function is an aggeragte function otherwise it is not.

Definition at line 118 of file FunctionDefn.h.

void te::da::FunctionDefn::setName ( const std::string &  name)
inline

It sets the function name;.

Parameters
nameThe function name.
Note
If the function belongs to a FunctionCatalog, don't call this method!

Definition at line 90 of file FunctionDefn.h.

void te::da::FunctionDefn::setRetValType ( int  r)
inline

It sets the data type of the return value.

Parameters
rThe data type of the return value.

Definition at line 104 of file FunctionDefn.h.

Member Data Documentation

std::string* te::da::FunctionDefn::m_description
protected

A brief description of the function.

Definition at line 167 of file FunctionDefn.h.

bool te::da::FunctionDefn::m_isAggregate
protected

A flag that defines if the function is an aggregate one.

Definition at line 166 of file FunctionDefn.h.

std::string te::da::FunctionDefn::m_name
protected

The function name. It may be an operator symbol or just a regular name like st_intersects.

Definition at line 163 of file FunctionDefn.h.

std::vector<FunctionParameter*> te::da::FunctionDefn::m_params
protected

The list of arguments.

Definition at line 164 of file FunctionDefn.h.

int te::da::FunctionDefn::m_retValType
protected

Data type of the return value.

Definition at line 165 of file FunctionDefn.h.


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