All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::da::BinaryFunction Class Referenceabstract

A base class for binary functions. More...

#include <BinaryFunction.h>

Inheritance diagram for te::da::BinaryFunction:
te::da::Function te::da::Expression te::common::BaseVisitable< QueryVisitor > te::da::BinaryOp te::da::ST_Contains te::da::ST_Crosses te::da::ST_Difference te::da::ST_Disjoint te::da::ST_EnvelopeIntersects te::da::ST_Equals te::da::ST_Intersection te::da::ST_Intersects te::da::ST_Overlaps te::da::ST_Touches te::da::ST_Within

Public Types

typedef R ReturnType
 
typedef QueryVisitor VisitorType
 

Public Member Functions

virtual ReturnType accept (VisitorType &guest) const =0
 It call the visit method from the guest object. More...
 
void add (Expression *arg)
 It adds the argument to the function list of arguments. More...
 
TE_DEFINE_VISITABLE BinaryFunction (const std::string &name, Expression *arg1, Expression *arg2)
 Constructor. More...
 
 BinaryFunction (const std::string &name, const Expression &arg1, const Expression &arg2)
 Constructor. More...
 
 BinaryFunction (const BinaryFunction &rhs)
 Copy constructor. More...
 
Expressionclone () const
 It creates a new copy of this expression. More...
 
ExpressiongetArg (std::size_t i) const
 It returns the i-th function argument. More...
 
ExpressiongetFirst () const
 It returns the first function argument. More...
 
const std::string & getName () const
 It returns the function name. More...
 
std::size_t getNumArgs () const
 It returns the number of arguments informed to the function. More...
 
ExpressiongetSecond () const
 It returns the second function argument. More...
 
BinaryFunctionoperator= (const BinaryFunction &rhs)
 
Expressionoperator[] (std::size_t i) const
 It returns the i-th function argument. More...
 
void setFirst (Expression *arg)
 It sets the first function argument. More...
 
void setSecond (Expression *arg)
 It sets the second function argument. More...
 
virtual ~BinaryFunction ()
 Virtual Destructor. More...
 

Protected Attributes

std::vector< Expression * > m_args
 The list of arguments. More...
 
std::string m_name
 The function name. May be an operator symbol or just a regular name like ST_Intersects. More...
 

Detailed Description

A base class for binary functions.

See also
Function, BinaryOp

Definition at line 43 of file BinaryFunction.h.

Member Typedef Documentation

typedef R te::common::BaseVisitable< QueryVisitor , R >::ReturnType
inherited

Definition at line 58 of file BaseVisitable.h.

Definition at line 57 of file BaseVisitable.h.

Constructor & Destructor Documentation

te::da::BinaryFunction::BinaryFunction ( const std::string &  name,
Expression arg1,
Expression arg2 
)

Constructor.

Parameters
nameThe function name.
arg1The first argument.
arg2The second argument.
Note
The BinaryFunction will take the ownership of the given arguments.

Definition at line 32 of file BinaryFunction.cpp.

References te::da::Function::m_args.

te::da::BinaryFunction::BinaryFunction ( const std::string &  name,
const Expression arg1,
const Expression arg2 
)

Constructor.

Parameters
nameThe function name.
arg1The first argument.
arg2The second argument.

Definition at line 40 of file BinaryFunction.cpp.

References te::da::Expression::clone(), and te::da::Function::m_args.

te::da::BinaryFunction::BinaryFunction ( const BinaryFunction rhs)

Copy constructor.

Definition at line 47 of file BinaryFunction.cpp.

te::da::BinaryFunction::~BinaryFunction ( )
virtual

Virtual Destructor.

Definition at line 52 of file BinaryFunction.cpp.

Member Function Documentation

virtual ReturnType te::common::BaseVisitable< QueryVisitor , R >::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::da::Function::add ( Expression arg)
inherited

It adds the argument to the function list of arguments.

Parameters
argThe argument to be added.
Note
The Function will take the ownership of the given argument.

Definition at line 79 of file Function.cpp.

Referenced by te::map::QueryEncoder::getExpression(), te::da::ObjectIdSet::getExpressionByInClause(), te::da::ObjectIdSet::setExpressionByInClause(), and te::map::QueryEncoder::visit().

te::da::Expression * te::da::Function::getArg ( std::size_t  i) const
inherited

It returns the i-th function argument.

Parameters
iThe argument position.
Returns
The it-th function argument.

Definition at line 67 of file Function.cpp.

Referenced by te::da::SpatialRestrictionVisitor::getGeometryRestriction(), te::da::SpatialRestrictionVisitor::getPropertyName(), te::da::SpatialRestrictionVisitor::isFromEnvelope(), and te::serialize::xml::Save().

te::da::Expression * te::da::BinaryFunction::getFirst ( ) const

It returns the first function argument.

Returns
The first function argument.

Definition at line 67 of file BinaryFunction.cpp.

Referenced by te::ado::SQLVisitor::visit().

te::da::Expression * te::da::BinaryFunction::getSecond ( ) const

It returns the second function argument.

Returns
The second function argument.

Definition at line 80 of file BinaryFunction.cpp.

Referenced by te::ado::SQLVisitor::visit().

te::da::Expression * te::da::Function::operator[] ( std::size_t  i) const
inherited

It returns the i-th function argument.

Parameters
iThe argument position.
Returns
The it-th function argument.

Definition at line 73 of file Function.cpp.

void te::da::BinaryFunction::setFirst ( Expression arg)

It sets the first function argument.

Parameters
argThe first function argument.
Note
The BinaryFunction will take the ownership of the given argument.

Definition at line 73 of file BinaryFunction.cpp.

void te::da::BinaryFunction::setSecond ( Expression arg)

It sets the second function argument.

Parameters
argThe second function argument.
Note
The BinaryFunction will take the ownership of the given argument.

Definition at line 86 of file BinaryFunction.cpp.

Member Data Documentation

std::string te::da::Function::m_name
protectedinherited

The function name. May be an operator symbol or just a regular name like ST_Intersects.

Definition at line 117 of file Function.h.

Referenced by te::da::Function::operator=().


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