Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

uesqlc::TAbstractConnectionManager< TConnectionData, TResult > Class Template Reference

#include <abstract_connection_manager.hh>

Inheritance diagram for uesqlc::TAbstractConnectionManager< TConnectionData, TResult >:

uesqlc::TSqlstateDescriptor List of all members.

Public Methods

 TAbstractConnectionManager (void)
 Builds a new instance.

virtual ~TAbstractConnectionManager (void)
 Destroys the instance.

void bindConnection (const mpcl::text::TString &rkyCONNECTION_NAME, TConnectionData &rtCONNECTION)
virtual void diagnose (TResult tRESULT)=0
void unbindConnection (const mpcl::text::TString kyCONNECTION_NAME)
void unbindCurrentConnection (void)
 Unbinds current connection (if any).

void unbindAllConnections (void)
 Unbinds all connections.

virtual void clearQueues (void)
virtual void clearResult (TResult tRESULT)=0
virtual TResult execute (const mpcl::text::TString &rkySTATEMENT)
virtual TResult execute (const mpcl::text::TString &rkySTATEMENT, const mpcl::text::TString &rkyCONNECTION_NAME)
virtual TResult execute (const char *pkcSTATEMENT)=0
virtual TResult execute (const char *pkcSTATEMENT, const char *pkyCONNECTION_NAME)=0
virtual void executeClean (const char *pkcSTATEMENT)
virtual void finish (void)
 Finishes all managed issues.

virtual ITypegetFromOutputQueue (const size_t zINDEX) const
virtual void initialize (void)
 Initializes the default connection.

mpcl::text::TString instantiate (const char *pkcSTATEMENT)
mpcl::text::TString instantiate (const mpcl::text::TString &rkySTATEMENT)
virtual void pushOnInputQueue (const IType &rktEMBEDDED_VALUE)
virtual ITypepopFromOutputQueue (void)
virtual void pushOnOutputQueue (IType *ptSQL_DATA_TYPE)
void resetStatus (void)
 Resets SQL status variables.

void setCurrentConnection (const mpcl::text::TString &rkyCONNECTION_NAME)
virtual void updateOutputVariables (void)
TConnectionData & getCurrentConnectionData (void)
const mpcl::text::TStringcurrentConnectionName (void) const
virtual bool existsDefaultConnection (void) const
bool isConnected (const mpcl::text::TString &rkyCONNECTION_NAME) const
bool isNotFoundCondition (void) const
bool isSqlerrorCondition (void) const

Protected Types

typedef mpcl::util::collection::TMap<
mpcl::text::TString, TConnectionData > 
TConnectionDataMap
 Map type that binds connection names to connections.


Protected Attributes

int iUniqueOrdinal
 Integer with the ordinal of the next unique connection name.

TConnectionDataMap tConnectionDataMap
 Map that binds connection names to connections.

TConnectionData * ptCurrentConnection
 Current connection (from tConnectionDataMap).

std::queue< mpcl::text::TStringtInputEmbeddedVariableQueue
 Input embedded variable string values queue.

std::vector< IType * > tOutputEmbeddedVariableVector
 Output embedded variable string pointers vector.

mpcl::text::TString yCurrentConnection
 String with the identifier of the current connection.


Detailed Description

template<typename TConnectionData, typename TResult>
class uesqlc::TAbstractConnectionManager< TConnectionData, TResult >

UESQL base manager class. The methods required for type TConnectionData are:

TConnectionData::TConnectionData (const TConnectionData& rktCONNECTION); void TConnectionData::close();

Definition at line 78 of file abstract_connection_manager.hh.


Member Function Documentation

template<typename TConnectionData, typename TResult>
void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::bindConnection const mpcl::text::TString   rkyCONNECTION_NAME,
TConnectionData &    rtCONNECTION
[inline]
 

Binds in connection map, connection name rkyCONNECTION_NAME to rtCONNECTION.

Parameters:
rkyCONNECTION_NAME  Connection name.
rtCONNECTION  Connection.

Definition at line 138 of file abstract_connection_manager.hh.

References mpcl::util::collection::TMap< mpcl::text::TString, TConnectionData >::bind().

template<typename TConnectionData, typename TResult>
virtual void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::clearQueues void    [inline, virtual]
 

Clears embedded variable containers. It must be called at the beginning of each new instruction.

Definition at line 204 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tInputEmbeddedVariableQueue, and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tOutputEmbeddedVariableVector.

Referenced by uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::finish().

template<typename TConnectionData, typename TResult>
virtual void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::clearResult TResult    tRESULT [pure virtual]
 

Clears the result of the last executed statement. The diagnostic member functions, use that results to diagnose the execution.

Referenced by uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::executeClean().

template<typename TConnectionData, typename TResult>
const mpcl::text::TString& uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::currentConnectionName void    const [inline]
 

Returns the connection name for the current connection.

Returns:
The connection name for the current connection.

Definition at line 396 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::yCurrentConnection.

template<typename TConnectionData, typename TResult>
virtual void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::diagnose TResult    tRESULT [pure virtual]
 

Diagnoses statement result (tRESULT). It only cheks the result of the statement executed. This member function (diagnose()) updates properly SQL status variables.

Parameters:
tRESULT  Source statement execution result.

template<typename TConnectionData, typename TResult>
virtual TResult uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute const char *    pkcSTATEMENT,
const char *    pkyCONNECTION_NAME
[pure virtual]
 

Executes the statement pkcSTATEMENT instantiating the input embedded variables (tagged with '$z') in the determinate connection named rkyCONNECTION_NAME.

Parameters:
pkcSTATEMENT  String with the source statement.
pkcCONNECTION_NAME  Source connection name.

template<typename TConnectionData, typename TResult>
virtual TResult uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute const char *    pkcSTATEMENT [pure virtual]
 

Executes the statement pkcSTATEMENT instantiating the input embedded variables (tagged with '$z').

Parameters:
pkcSTATEMENT  String with the source statement.

template<typename TConnectionData, typename TResult>
virtual TResult uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute const mpcl::text::TString   rkySTATEMENT,
const mpcl::text::TString   rkyCONNECTION_NAME
[inline, virtual]
 

Executes the statement rkySTATEMENT instantiating the input embedded variables (tagged with '$z') in the determinate connection named rkyCONNECTION_NAME.

Parameters:
rkySTATEMENT  String with the source statement.
rkyCONNECTION_NAME  Source connection name.

Definition at line 237 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute().

template<typename TConnectionData, typename TResult>
virtual TResult uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute const mpcl::text::TString   rkySTATEMENT [inline, virtual]
 

Executes the statement rkySTATEMENT instantiating the input embedded variables (tagged with '$z').

Parameters:
rkySTATEMENT  String with the source statement.

Definition at line 225 of file abstract_connection_manager.hh.

Referenced by uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute(), and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::executeClean().

template<typename TConnectionData, typename TResult>
virtual void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::executeClean const char *    pkcSTATEMENT [inline, virtual]
 

Executes the statement pkcSTATEMENT instantiating the input embedded variables (tagged with '$z'). The result of the execution is omitted.

Parameters:
pkcSTATEMENT  String with the source statement.

Definition at line 266 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::clearResult(), and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::execute().

template<typename TConnectionData, typename TResult>
virtual bool uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::existsDefaultConnection void    const [inline, virtual]
 

Returns true if there is a default connection.

Returns:
True if there is a default connection.

Definition at line 405 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::ptCurrentConnection.

Referenced by uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::unbindCurrentConnection().

template<typename TConnectionData, typename TResult>
TConnectionData& uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::getCurrentConnectionData void    [inline]
 

Returns the current connection data.

Returns:
The current connection data.

Definition at line 383 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::ptCurrentConnection.

template<typename TConnectionData, typename TResult>
virtual IType* uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::getFromOutputQueue const size_t    zINDEX const [inline, virtual]
 

Gets a pointer to the SQL data type of the output embedded variable at position zINDEX in the output embedded variable vector. It must be called for writing results on output embedded variables.

Parameters:
zINDEX  Position of the variable.
Returns:
Pointer to the output embedded variable.

Definition at line 287 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tOutputEmbeddedVariableVector.

template<typename TConnectionData, typename TResult>
mpcl::text::TString uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::instantiate const mpcl::text::TString   rkySTATEMENT [inline]
 

Returns a string that is result of instanting the input embedded variables (if any).

Parameters:
rkySTATEMENT  Source statement.
Returns:
The instantiated version of string rkySTATEMENT.

Definition at line 313 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::instantiate().

template<typename TConnectionData, typename TResult>
mpcl::text::TString uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::instantiate const char *    pkcSTATEMENT [inline]
 

Returns a string that is result of instanting the input embedded variables (if any).

Parameters:
pkcSTATEMENT  Source statement.
Returns:
The instantiated string.

Definition at line 449 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tInputEmbeddedVariableQueue.

Referenced by uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::instantiate().

template<typename TConnectionData, typename TResult>
bool uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::isConnected const mpcl::text::TString   rkyCONNECTION_NAME const [inline]
 

Returns true if there is an active connection.

Parameters:
rkyCONNECTION_NAME  Source connection name to check.
Returns:
True if there is an active connection.

Definition at line 415 of file abstract_connection_manager.hh.

References mpcl::util::collection::TMap< mpcl::text::TString, TConnectionData >::isBound().

template<typename TConnectionData, typename TResult>
bool uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::isNotFoundCondition void    const [inline]
 

Checks if a NOT FOUND condition has happened.

Returns:
True if it has happened.

Definition at line 424 of file abstract_connection_manager.hh.

References uesqlc::SQLSTATE.

template<typename TConnectionData, typename TResult>
bool uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::isSqlerrorCondition void    const [inline]
 

Checks if a SQLERROR condition has happened.

Returns:
True if it has happened.

Definition at line 433 of file abstract_connection_manager.hh.

References uesqlc::SQLCODE.

template<typename TConnectionData, typename TResult>
virtual IType* uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::popFromOutputQueue void    [inline, virtual]
 

Pops from the output embedded variable vector the last variable.

Returns:
The last added embedded variable reference.

Definition at line 331 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tOutputEmbeddedVariableVector.

template<typename TConnectionData, typename TResult>
virtual void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::pushOnInputQueue const IType   rktEMBEDDED_VALUE [inline, virtual]
 

Pushes an input embedded variable value into the input queue.

Parameters:
rktEMBEDDED_VALUE  Input embedded variable value.

Definition at line 322 of file abstract_connection_manager.hh.

References uesqlc::IType::get(), and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tInputEmbeddedVariableQueue.

template<typename TConnectionData, typename TResult>
virtual void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::pushOnOutputQueue IType   ptSQL_DATA_TYPE [inline, virtual]
 

Pushes on the output embedded variable vector the variable reference rtSQL_DATA_TYPE.

Parameters:
rtSQL_DATA_TYPE  Output embedded variable reference.

Definition at line 344 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tOutputEmbeddedVariableVector.

template<typename TConnectionData, typename TResult>
void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::setCurrentConnection const mpcl::text::TString   rkyCONNECTION_NAME [inline]
 

Sets current connection to connection named rkyCONNECTION_NAME.

Parameters:
rkyCONNECTION_NAME  Source connection name.

Definition at line 476 of file abstract_connection_manager.hh.

References mpcl::util::collection::TMap< mpcl::text::TString, TConnectionData >::isBound(), uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::ptCurrentConnection, uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::resetStatus(), uesqlc::SQLCODE, uesqlc::SQLMESSAGE, uesqlc::SQLSTATE, uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tConnectionDataMap, and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::yCurrentConnection.

template<typename TConnectionData, typename TResult>
void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::unbindConnection const mpcl::text::TString    kyCONNECTION_NAME [inline]
 

Unbinds connection named rkyCONNECTION_NAME.

Parameters:
rkyCONNECTION_NAME  Source connection name.
Warning:
kyCONNECTION_NAME mustn't be passed as reference to avoid problems about passing yCurrentConnection as argument.

Definition at line 158 of file abstract_connection_manager.hh.

References uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::ptCurrentConnection, and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::yCurrentConnection.

Referenced by uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::unbindAllConnections(), and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::unbindCurrentConnection().

template<typename TConnectionData, typename TResult>
void uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::updateOutputVariables void    [inline, virtual]
 

Updates output variables (which have been updated passively using a temporary buffer).

Definition at line 504 of file abstract_connection_manager.hh.

References mpcl::util::logging::header(), mpcl::util::logging::tLog, and uesqlc::TAbstractConnectionManager< TConnectionData, TResult >::tOutputEmbeddedVariableVector.


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:40:12 2003 for UESQLC by doxygen1.2.18