te::da::TemplateEncoder Class Reference

A query encoder for binary operator expressions. More...

#include <TemplateEncoder.h>

Inheritance diagram for te::da::TemplateEncoder:
te::da::SQLFunctionEncoder

Public Member Functions

 TemplateEncoder (const std::string &name, const std::string &t)
 Constructor. More...
 
void toSQL (const Function &f, std::string &buff, SQLVisitor &v) const
 It encodes the function to a SQL notation. More...
 
 ~TemplateEncoder ()
 Destructor. More...
 

Protected Attributes

std::string m_name
 The alias to the function. More...
 

Private Attributes

std::vector< std::size_t > m_argIdx
 The arguments index. More...
 
std::vector< std::string > m_chuncks
 We split the input template into some pieces and make them prepared to concatenate. More...
 

Detailed Description

A query encoder for binary operator expressions.

You can use a special notation in order to translate the function arguments to a specific dialect convetion.

You can write an expression like: ($1 from $2 for $3) in order to write a function with arguments in differnt positions. The $n numbers will be used to map the arguments to its right place.

See also
Function, TemplateEncoder, AbstractOperatorEncoder, UnaryOperatorEncoder, FunctionEncoder, FunctionNoArgsEncoder

Definition at line 52 of file TemplateEncoder.h.

Constructor & Destructor Documentation

te::da::TemplateEncoder::TemplateEncoder ( const std::string &  name,
const std::string &  t 
)

Constructor.

Parameters
nameThe function alias name.
tThe expression template.
te::da::TemplateEncoder::~TemplateEncoder ( )
inline

Destructor.

Definition at line 65 of file TemplateEncoder.h.

Member Function Documentation

void te::da::TemplateEncoder::toSQL ( const Function f,
std::string &  buff,
SQLVisitor v 
) const
virtual

It encodes the function to a SQL notation.

Parameters
fThe function to be translated to a SQL notation.
buffThe destination string buffer where the translation will be written.
vThe SQL visitor that will be used to visit the arguments expression.

Implements te::da::SQLFunctionEncoder.

Member Data Documentation

std::vector<std::size_t> te::da::TemplateEncoder::m_argIdx
private

The arguments index.

Definition at line 81 of file TemplateEncoder.h.

std::vector<std::string> te::da::TemplateEncoder::m_chuncks
private

We split the input template into some pieces and make them prepared to concatenate.

Definition at line 80 of file TemplateEncoder.h.

std::string te::da::SQLFunctionEncoder::m_name
protectedinherited

The alias to the function.

Definition at line 88 of file SQLFunctionEncoder.h.


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