NCBI C++ ToolKit
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CQueryImpl Class Reference

Search Toolkit Book for CQueryImpl

#include "sdbapi_impl.hpp"
(Private to src/dbapi/simple.)

+ Inheritance diagram for CQueryImpl:
+ Collaboration diagram for CQueryImpl:

Public Member Functions

 CQueryImpl (CDatabaseImpl *db_impl)
 
 ~CQueryImpl (void)
 
template<class T >
void SetParameter (CTempString name, const T &value, ESDB_Type type, ESP_ParamType param_type)
 
void SetNullParameter (CTempString name, ESDB_Type type, ESP_ParamType param_type)
 
const CQuery::CFieldGetParameter (CTempString name)
 
void ClearParameter (CTempString name)
 
void ClearParameters (void)
 
void SetSql (CTempString sql)
 
void Execute (const CTimeout &timeout)
 
void ExecuteSP (CTempString sp, const CTimeout &timeout)
 
void Cancel (void)
 
bool HasMoreResultSets (void)
 
void PurgeResults (void)
 
void BeginNewRS (void)
 
void Next (void)
 
void RequireRowCount (unsigned int min_rows, unsigned int max_rows)
 
void VerifyDone (CQuery::EHowMuch how_much=CQuery::eThisResultSet)
 
const CQuery::CRowGetRow (void) const
 
const CQuery::CFieldGetColumn (const CDBParamVariant &col) const
 
const CVariantGetFieldValue (unsigned int col_num)
 
bool IsFinished (CQuery::EHowMuch how_much=CQuery::eThisResultSet) const
 
void SetIgnoreBounds (bool is_ignore)
 
unsigned int GetResultSetNo (void) const
 
unsigned int GetRowNo (CQuery::EHowMuch how_much=CQuery::eAllResultSets) const
 
int GetRowCount (void) const
 
int GetStatus (void) const
 
unsigned int GetTotalColumns (void) const
 
string GetColumnName (unsigned int col) const
 
ESDB_Type GetColumnType (unsigned int col) const
 
CDatabaseImplGetDatabase (void) const
 
IConnectionGetConnection (void)
 
const list< string > & GetPrintOutput (void) const
 
const CDB_Exception::SContextx_GetContext (void) const
 
unsigned int GetMinRowCount (void) const
 
unsigned int GetMaxRowCount (void) const
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Private Types

typedef map< string, CQuery::CFieldTParamsMap
 

Private Member Functions

void x_CheckCanWork (bool need_rs=false) const
 
void x_SetOutParameter (const string &name, const CVariant &value)
 
void x_ClearAllParams (void)
 
void x_CheckRowCount (void)
 
bool x_Fetch (void)
 
void x_InitBeforeExec (void)
 
void x_InitRSFields (void)
 
void x_DetachAllFields (void)
 
void x_Close (void)
 

Private Attributes

CRef< CDatabaseImplm_DBImpl
 
IStatementm_Stmt
 
ICallableStatementm_CallStmt
 
TParamsMap m_Params
 
string m_Sql
 
IResultSetm_CurRS
 
bool m_IgnoreBounds
 
bool m_HasExplicitMode
 
bool m_RSBeginned
 
bool m_RSFinished
 
bool m_Executed
 
bool m_ReportedWrongRowCount
 
bool m_IsSP
 
bool m_RowUnderConstruction
 
unsigned int m_CurRSNo
 
unsigned int m_CurRowNo
 
unsigned int m_CurRelRowNo
 
unsigned int m_MinRowCount
 
unsigned int m_MaxRowCount
 
int m_RowCount
 
int m_Status
 
CQuery::CRow m_Row
 
CRef< CDB_Exception::SContextm_Context
 

Additional Inherited Members

- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Definition at line 286 of file sdbapi_impl.hpp.

Member Typedef Documentation

◆ TParamsMap

Definition at line 347 of file sdbapi_impl.hpp.

Constructor & Destructor Documentation

◆ CQueryImpl()

CQueryImpl::CQueryImpl ( CDatabaseImpl db_impl)
inline

Definition at line 2673 of file sdbapi.cpp.

References CDatabaseImpl::GetConnection(), IConnection::GetStatement(), and m_Stmt.

◆ ~CQueryImpl()

CQueryImpl::~CQueryImpl ( void  )

Definition at line 2698 of file sdbapi.cpp.

References m_Stmt, STD_CATCH_ALL_X, x_ClearAllParams(), and x_Close().

Member Function Documentation

◆ BeginNewRS()

void CQueryImpl::BeginNewRS ( void  )

◆ Cancel()

void CQueryImpl::Cancel ( void  )
inline

Definition at line 3019 of file sdbapi.cpp.

References m_CallStmt, m_Stmt, stmt, x_CheckCanWork(), and x_DetachAllFields().

Referenced by CQuery::Cancel().

◆ ClearParameter()

void CQueryImpl::ClearParameter ( CTempString  name)
inline

◆ ClearParameters()

void CQueryImpl::ClearParameters ( void  )
inline

◆ Execute()

void CQueryImpl::Execute ( const CTimeout timeout)
inline

◆ ExecuteSP()

void CQueryImpl::ExecuteSP ( CTempString  sp,
const CTimeout timeout 
)
inline

◆ GetColumn()

const CQuery::CField & CQueryImpl::GetColumn ( const CDBParamVariant col) const
inline

◆ GetColumnName()

string CQueryImpl::GetColumnName ( unsigned int  col) const
inline

Definition at line 3300 of file sdbapi.cpp.

References CQuery::CRow::GetColumnName(), m_Row, and x_CheckCanWork().

Referenced by CQuery::GetColumnName().

◆ GetColumnType()

ESDB_Type CQueryImpl::GetColumnType ( unsigned int  col) const
inline

◆ GetConnection()

IConnection * CQueryImpl::GetConnection ( void  )
inline

Definition at line 3443 of file sdbapi.cpp.

References CDatabaseImpl::GetConnection(), and m_DBImpl.

◆ GetDatabase()

CDatabaseImpl * CQueryImpl::GetDatabase ( void  ) const
inline

Definition at line 3437 of file sdbapi.cpp.

References CRef< C, Locker >::GetNCPointer(), and m_DBImpl.

◆ GetFieldValue()

const CVariant & CQueryImpl::GetFieldValue ( unsigned int  col_num)
inline

Definition at line 2828 of file sdbapi.cpp.

References IResultSet::GetVariant(), and m_CurRS.

Referenced by CRemoteQFB::GetValue().

◆ GetMaxRowCount()

unsigned int CQueryImpl::GetMaxRowCount ( void  ) const
inline

Definition at line 332 of file sdbapi_impl.hpp.

References m_MaxRowCount.

Referenced by CQuery::GetTheOnlyRow().

◆ GetMinRowCount()

unsigned int CQueryImpl::GetMinRowCount ( void  ) const
inline

Definition at line 330 of file sdbapi_impl.hpp.

References m_MinRowCount.

Referenced by CQuery::GetTheOnlyRow().

◆ GetParameter()

const CQuery::CField & CQueryImpl::GetParameter ( CTempString  name)
inline

◆ GetPrintOutput()

const list< string > & CQueryImpl::GetPrintOutput ( void  ) const
inline

Definition at line 3449 of file sdbapi.cpp.

References CDatabaseImpl::GetPrintOutput(), and m_DBImpl.

Referenced by CQuery::GetPrintOutput().

◆ GetResultSetNo()

unsigned int CQueryImpl::GetResultSetNo ( void  ) const
inline

Definition at line 3037 of file sdbapi.cpp.

References m_CurRSNo, and x_CheckCanWork().

Referenced by CQuery::GetResultSetNo().

◆ GetRow()

const CQuery::CRow & CQueryImpl::GetRow ( void  ) const
inline

Definition at line 3423 of file sdbapi.cpp.

References m_Row, and x_CheckCanWork().

◆ GetRowCount()

int CQueryImpl::GetRowCount ( void  ) const
inline

◆ GetRowNo()

unsigned int CQueryImpl::GetRowNo ( CQuery::EHowMuch  how_much = CQuery::eAllResultSets) const
inline

Definition at line 3044 of file sdbapi.cpp.

References CQuery::eAllResultSets, m_CurRelRowNo, m_CurRowNo, m_IgnoreBounds, and x_CheckCanWork().

Referenced by CQuery::GetRowNo().

◆ GetStatus()

int CQueryImpl::GetStatus ( void  ) const
inline

◆ GetTotalColumns()

unsigned int CQueryImpl::GetTotalColumns ( void  ) const
inline

Definition at line 3293 of file sdbapi.cpp.

References CQuery::CRow::GetTotalColumns(), m_Row, and x_CheckCanWork().

Referenced by CQuery::GetTotalColumns().

◆ HasMoreResultSets()

bool CQueryImpl::HasMoreResultSets ( void  )

◆ IsFinished()

bool CQueryImpl::IsFinished ( CQuery::EHowMuch  how_much = CQuery::eThisResultSet) const
inline

◆ Next()

void CQueryImpl::Next ( void  )
inline

Definition at line 3321 of file sdbapi.cpp.

References HasMoreResultSets(), m_IgnoreBounds, m_RSBeginned, and x_Fetch().

◆ PurgeResults()

void CQueryImpl::PurgeResults ( void  )
inline

◆ RequireRowCount()

void CQueryImpl::RequireRowCount ( unsigned int  min_rows,
unsigned int  max_rows 
)
inline

◆ SetIgnoreBounds()

void CQueryImpl::SetIgnoreBounds ( bool  is_ignore)
inline

◆ SetNullParameter()

void CQueryImpl::SetNullParameter ( CTempString  name,
ESDB_Type  type,
ESP_ParamType  param_type 
)
inline

◆ SetParameter()

template<class T >
void CQueryImpl::SetParameter ( CTempString  name,
const T value,
ESDB_Type  type,
ESP_ParamType  param_type 
)
inline

◆ SetSql()

void CQueryImpl::SetSql ( CTempString  sql)
inline

Definition at line 2888 of file sdbapi.cpp.

References CDB_Exception::SContext::extra_msg, m_Context, m_Executed, m_IsSP, m_Sql, sql, and x_CheckCanWork().

Referenced by CQuery::SetSql().

◆ VerifyDone()

void CQueryImpl::VerifyDone ( CQuery::EHowMuch  how_much = CQuery::eThisResultSet)
inline

◆ x_CheckCanWork()

void CQueryImpl::x_CheckCanWork ( bool  need_rs = false) const
private

◆ x_CheckRowCount()

void CQueryImpl::x_CheckRowCount ( void  )
private

◆ x_ClearAllParams()

void CQueryImpl::x_ClearAllParams ( void  )
private

◆ x_Close()

void CQueryImpl::x_Close ( void  )
private

◆ x_DetachAllFields()

void CQueryImpl::x_DetachAllFields ( void  )
private

Definition at line 2898 of file sdbapi.cpp.

References f(), CQuery::CRow::m_Fields, and m_Row.

Referenced by Cancel(), x_Fetch(), and x_InitRSFields().

◆ x_Fetch()

bool CQueryImpl::x_Fetch ( void  )
inlineprivate

◆ x_GetContext()

const CDB_Exception::SContext & CQueryImpl::x_GetContext ( void  ) const

◆ x_InitBeforeExec()

void CQueryImpl::x_InitBeforeExec ( void  )
inlineprivate

◆ x_InitRSFields()

void CQueryImpl::x_InitRSFields ( void  )
inlineprivate

◆ x_SetOutParameter()

void CQueryImpl::x_SetOutParameter ( const string name,
const CVariant value 
)
inlineprivate

Member Data Documentation

◆ m_CallStmt

ICallableStatement* CQueryImpl::m_CallStmt
private

Definition at line 351 of file sdbapi_impl.hpp.

Referenced by Cancel(), ExecuteSP(), HasMoreResultSets(), and x_Close().

◆ m_Context

CRef<CDB_Exception::SContext> CQueryImpl::m_Context
mutableprivate

◆ m_CurRelRowNo

unsigned int CQueryImpl::m_CurRelRowNo
private

◆ m_CurRowNo

unsigned int CQueryImpl::m_CurRowNo
private

◆ m_CurRS

IResultSet* CQueryImpl::m_CurRS
private

◆ m_CurRSNo

unsigned int CQueryImpl::m_CurRSNo
private

Definition at line 363 of file sdbapi_impl.hpp.

Referenced by GetResultSetNo(), HasMoreResultSets(), x_Close(), and x_InitBeforeExec().

◆ m_DBImpl

CRef<CDatabaseImpl> CQueryImpl::m_DBImpl
private

◆ m_Executed

bool CQueryImpl::m_Executed
private

Definition at line 359 of file sdbapi_impl.hpp.

Referenced by BeginNewRS(), Execute(), ExecuteSP(), RequireRowCount(), and SetSql().

◆ m_HasExplicitMode

bool CQueryImpl::m_HasExplicitMode
private

◆ m_IgnoreBounds

bool CQueryImpl::m_IgnoreBounds
private

◆ m_IsSP

bool CQueryImpl::m_IsSP
private

Definition at line 361 of file sdbapi_impl.hpp.

Referenced by Execute(), ExecuteSP(), SetSql(), and x_GetContext().

◆ m_MaxRowCount

unsigned int CQueryImpl::m_MaxRowCount
private

◆ m_MinRowCount

unsigned int CQueryImpl::m_MinRowCount
private

◆ m_Params

TParamsMap CQueryImpl::m_Params
private

◆ m_ReportedWrongRowCount

bool CQueryImpl::m_ReportedWrongRowCount
private

Definition at line 360 of file sdbapi_impl.hpp.

Referenced by HasMoreResultSets(), x_CheckRowCount(), and x_InitBeforeExec().

◆ m_Row

CQuery::CRow CQueryImpl::m_Row
private

◆ m_RowCount

int CQueryImpl::m_RowCount
private

Definition at line 368 of file sdbapi_impl.hpp.

Referenced by GetRowCount(), HasMoreResultSets(), x_CheckRowCount(), and x_InitBeforeExec().

◆ m_RowUnderConstruction

bool CQueryImpl::m_RowUnderConstruction
private

Definition at line 362 of file sdbapi_impl.hpp.

Referenced by GetColumnType(), and x_InitRSFields().

◆ m_RSBeginned

bool CQueryImpl::m_RSBeginned
private

Definition at line 357 of file sdbapi_impl.hpp.

Referenced by BeginNewRS(), HasMoreResultSets(), Next(), VerifyDone(), and x_InitBeforeExec().

◆ m_RSFinished

bool CQueryImpl::m_RSFinished
private

◆ m_Sql

string CQueryImpl::m_Sql
private

Definition at line 353 of file sdbapi_impl.hpp.

Referenced by Execute(), ExecuteSP(), SetSql(), and x_GetContext().

◆ m_Status

int CQueryImpl::m_Status
private

Definition at line 369 of file sdbapi_impl.hpp.

Referenced by GetStatus(), HasMoreResultSets(), and x_InitBeforeExec().

◆ m_Stmt

IStatement* CQueryImpl::m_Stmt
private

The documentation for this class was generated from the following files:
Modified on Sun Apr 21 03:44:23 2024 by modify_doxy.py rev. 669887