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

It represents the SQL query dialect accepted by a given data source. More...

#include <SQLDialect.h>

Inheritance diagram for te::da::SQLDialect:

Public Member Functions

const SQLFunctionEncoderfind (const std::string &funcName) const
 It searches for an encoder for the given function. More...
 
std::vector< std::string > getRegisteredNames () const
 It gets the all registered names from registed functions. More...
 
void insert (const std::string &funcName, SQLFunctionEncoder *encoder)
 It adds a new encoder for a given function. More...
 
 SQLDialect ()
 Default constructor. More...
 
 ~SQLDialect ()
 Destructor. More...
 

Private Attributes

std::map< std::string,
SQLFunctionEncoder * > 
m_regFunctions
 A map from the TerraLib general name to a given SQL formatter. More...
 

Detailed Description

It represents the SQL query dialect accepted by a given data source.

This class is target for the portability of TerraLib...

Definition at line 55 of file SQLDialect.h.

Constructor & Destructor Documentation

te::da::SQLDialect::SQLDialect ( )
inline

Default constructor.

Definition at line 60 of file SQLDialect.h.

te::da::SQLDialect::~SQLDialect ( )

Destructor.

Definition at line 33 of file SQLDialect.cpp.

References te::common::FreeContents(), and m_regFunctions.

Member Function Documentation

const te::da::SQLFunctionEncoder * te::da::SQLDialect::find ( const std::string &  funcName) const

It searches for an encoder for the given function.

Parameters
funcNameThe function name.
Returns
An encoder or NULL if none is found.

Definition at line 46 of file SQLDialect.cpp.

References te::common::GetPValue().

std::vector< std::string > te::da::SQLDialect::getRegisteredNames ( ) const

It gets the all registered names from registed functions.

Returns
A vector with TerraLib general name for SQL functions.

Definition at line 51 of file SQLDialect.cpp.

Referenced by te::qt::widgets::QueryDataSourceDialog::buildMap().

void te::da::SQLDialect::insert ( const std::string &  funcName,
SQLFunctionEncoder encoder 
)

It adds a new encoder for a given function.

Parameters
funcNameThe function name.
encoderThe SQL dialect encoder for the given function.
Exceptions
ExceptionIt thorws an exception if a given function is already registered.
Note
The SQLDialect will take the ownership of the given encoder.

Definition at line 38 of file SQLDialect.cpp.

References te::common::GetPValue(), and TE_TR.

Referenced by te::serialize::xml::Read().

Member Data Documentation

std::map<std::string, SQLFunctionEncoder*> te::da::SQLDialect::m_regFunctions
private

A map from the TerraLib general name to a given SQL formatter.

Definition at line 96 of file SQLDialect.h.

Referenced by ~SQLDialect().


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