NCBI C++ ToolKit
Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CTL_CursorResultExpl Class Reference

Search Toolkit Book for CTL_CursorResultExpl

#include <dbapi/driver/ctlib/interfaces.hpp>

+ Inheritance diagram for CTL_CursorResultExpl:
+ Collaboration diagram for CTL_CursorResultExpl:

Protected Member Functions

 CTL_CursorResultExpl (CTL_LangCmd *cmd, const string &cursor_name)
 
virtual ~CTL_CursorResultExpl (void)
 
virtual EDB_ResType ResultType (void) const
 Get type of the result. More...
 
virtual bool Fetch (void)
 Fetch next row. More...
 
virtual int CurrentItemNo (void) const
 Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available) to read. More...
 
virtual int GetColumnNum (void) const
 Return number of columns in the recordset. More...
 
virtual CDB_ObjectGetItem (CDB_Object *item_buff=0, I_Result::EGetItem policy=I_Result::eAppendLOB)
 Get a result item (you can use either GetItem or ReadItem). More...
 
virtual size_t ReadItem (void *buffer, size_t buffer_size, bool *is_null=0)
 Read a result item body (for BLOB columns, mostly). More...
 
virtual I_BlobDescriptorGetBlobDescriptor (void)
 Get a descriptor for a BLOB column (for SendData). More...
 
I_BlobDescriptorGetBlobDescriptor (int item_num)
 
virtual bool SkipItem (void)
 Skip result item. More...
 
- Protected Member Functions inherited from CTL_CursorResult
 CTL_CursorResult (CS_COMMAND *pCmd, CTL_Connection &conn, const string &cursor_name)
 
virtual ~CTL_CursorResult (void)
 
void x_InvalidateDescriptors (void)
 
- Protected Member Functions inherited from CTL_RowResult
 CTL_RowResult (CS_COMMAND *cmd, CTL_Connection &conn)
 
virtual ~CTL_RowResult (void)
 
void Close (void)
 
I_BlobDescriptorGetBlobDescriptor (int item_num)
 
CS_RETCODE my_ct_get_data (CS_COMMAND *cmd, CS_INT item, CS_VOID *buffer, CS_INT buflen, CS_INT *outlen, bool &is_null)
 
CDB_ObjectGetItemInternal (I_Result::EGetItem policy, CS_COMMAND *cmd, CS_INT item_no, CS_DATAFMT &fmt, CDB_Object *item_buf)
 
CS_COMMANDx_GetSybaseCmd (void) const
 
CS_RETCODE Check (CS_RETCODE rc)
 
CTL_ConnectionGetConnection (void)
 
const CTL_ConnectionGetConnection (void) const
 
const CTL_Connection::TDbgInfoGetDbgInfo (void) const
 
void SetCurrentItemNum (int num)
 
int GetCurrentItemNum (void) const
 
void IncCurrentItemNum (void)
 
bool IsDead (void) const
 
const CDBParamsGetLastParams (void) const
 
void CheckIsDead (void) const
 

Private Member Functions

CDB_ResultGetResultSet (void) const
 
void SetResultSet (CDB_Result *res)
 
void ClearResultSet (void)
 
void DumpResultSet (void)
 
void FetchAllResultSet (void)
 
CTL_LangCmdGetCmd (void)
 
CTL_LangCmd constGetCmd (void) const
 
void ClearFields (void)
 

Private Attributes

CTL_LangCmdm_Cmd
 
CDB_Resultm_Res
 
vector< CDB_Object * > m_Fields
 
vector< I_BlobDescriptor * > m_BlobDescrs
 
int m_CurItemNo
 
size_t m_ReadBytes
 
void * m_ReadBuffer
 
string m_CursorName
 

Friends

class CTL_CursorCmdExpl
 
struct default_delete< CTL_CursorResultExpl >
 

Additional Inherited Members

- Public Member Functions inherited from CTL_CursorResult
const stringGetCursorName (void) const
 
void RegisterDescriptor (CTL_CursorBlobDescriptor &desc)
 
void UnregisterDescriptor (CTL_CursorBlobDescriptor &desc)
 
- Public Member Functions inherited from impl::CResult
 CResult (void)
 
virtual ~CResult (void)
 
virtual const CDBParamsGetDefineParams (void) const
 
I_BlobDescriptorGetImageOrTextDescriptor (void)
 
void AttachTo (CDB_Result *interface)
 
const CDB_ParamsGetDefineParamsImpl (void) const
 
CDB_ParamsGetDefineParamsImpl (void)
 
- Protected Types inherited from CTL_RowResult
enum  ENullValue { eNullUnknown , eIsNull , eIsNotNull }
 
- Static Protected Member Functions inherited from CTL_RowResult
static EDB_Type ConvDataType_Ctlib2DBAPI (const CS_DATAFMT &fmt)
 
- Protected Attributes inherited from CTL_RowResult
CTL_Connectionm_Connect
 
CS_COMMANDm_Cmd
 
int m_CurrItem
 
bool m_EOR
 
AutoArray< CS_DATAFMTm_ColFmt
 
int m_BindedCols
 
AutoArray< CS_VOID * > m_BindItem
 
AutoArray< CS_INTm_Copied
 
AutoArray< CS_SMALLINTm_Indicator
 
AutoArray< ENullValuem_NullValue
 
unsigned char m_BindBuff [2048]
 
- Protected Attributes inherited from impl::CResult
CDB_Params m_DefineParams
 
CCachedRowInfo m_CachedRowInfo
 

Detailed Description

Definition at line 1330 of file interfaces.hpp.

Constructor & Destructor Documentation

◆ CTL_CursorResultExpl()

CTL_CursorResultExpl::CTL_CursorResultExpl ( CTL_LangCmd cmd,
const string cursor_name 
)
protected

Definition at line 1202 of file result.cpp.

◆ ~CTL_CursorResultExpl()

CTL_CursorResultExpl::~CTL_CursorResultExpl ( void  )
protectedvirtual

Definition at line 1574 of file result.cpp.

References ClearFields(), m_Res, NCBI_CATCH_ALL_X, and NCBI_CURRENT_FUNCTION.

Member Function Documentation

◆ ClearFields()

void CTL_CursorResultExpl::ClearFields ( void  )
private

Definition at line 1215 of file result.cpp.

References free(), ITERATE, m_BlobDescrs, m_Fields, m_ReadBuffer, and NULL.

Referenced by Fetch(), and ~CTL_CursorResultExpl().

◆ ClearResultSet()

void CTL_CursorResultExpl::ClearResultSet ( void  )
private

◆ CurrentItemNo()

int CTL_CursorResultExpl::CurrentItemNo ( void  ) const
protectedvirtual

Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available) to read.

Reimplemented from CTL_RowResult.

Definition at line 1318 of file result.cpp.

References m_CurItemNo.

◆ DumpResultSet()

void CTL_CursorResultExpl::DumpResultSet ( void  )
private

◆ Fetch()

bool CTL_CursorResultExpl::Fetch ( void  )
protectedvirtual

◆ FetchAllResultSet()

void CTL_CursorResultExpl::FetchAllResultSet ( void  )
private

◆ GetBlobDescriptor() [1/2]

I_BlobDescriptor * CTL_CursorResultExpl::GetBlobDescriptor ( int  item_num)
protected

Definition at line 1552 of file result.cpp.

References GetColumnNum(), m_BlobDescrs, NULL, and result.

◆ GetBlobDescriptor() [2/2]

virtual I_BlobDescriptor* CTL_CursorResultExpl::GetBlobDescriptor ( void  )
inlineprotectedvirtual

Get a descriptor for a BLOB column (for SendData).

Return NULL if this result doesn't (or can't) have a BLOB descriptor. NOTE: you need to call ReadItem (maybe even with buffer_size == 0) before calling this method!

Reimplemented from CTL_RowResult.

Definition at line 1348 of file interfaces.hpp.

◆ GetCmd() [1/2]

CTL_LangCmd& CTL_CursorResultExpl::GetCmd ( void  )
inlineprivate

Definition at line 1362 of file interfaces.hpp.

References _ASSERT.

Referenced by Fetch().

◆ GetCmd() [2/2]

CTL_LangCmd const& CTL_CursorResultExpl::GetCmd ( void  ) const
inlineprivate

Definition at line 1367 of file interfaces.hpp.

References _ASSERT.

◆ GetColumnNum()

int CTL_CursorResultExpl::GetColumnNum ( void  ) const
protectedvirtual

Return number of columns in the recordset.

Reimplemented from CTL_RowResult.

Definition at line 1324 of file result.cpp.

References int, and m_Fields.

Referenced by GetBlobDescriptor(), GetItem(), ReadItem(), and SkipItem().

◆ GetItem()

CDB_Object * CTL_CursorResultExpl::GetItem ( CDB_Object item_buf = 0,
I_Result::EGetItem  policy = I_Result::eAppendLOB 
)
protectedvirtual

Get a result item (you can use either GetItem or ReadItem).

If "item_buf" is not NULL, then use "*item_buf" (its type should be compatible with the type of retrieved item!) to retrieve the item to; otherwise allocate new "CDB_Object".

Reimplemented from CTL_RowResult.

Definition at line 1330 of file result.cpp.

References CDB_Stream::Append(), CDB_Object::AssignValue(), buffer, DATABASE_DRIVER_ERROR, I_Result::eAppendLOB, GetColumnNum(), CTL_RowResult::GetDbgInfo(), CDB_Object::GetType(), CDB_Object::IsBlobType(), m_CurItemNo, m_Fields, CDB_Stream::MoveTo(), NULL, CDB_Stream::Read(), read_size(), CDB_Stream::Size(), and total_size.

◆ GetResultSet()

CDB_Result* CTL_CursorResultExpl::GetResultSet ( void  ) const
private

◆ ReadItem()

size_t CTL_CursorResultExpl::ReadItem ( void *  buffer,
size_t  buffer_size,
bool is_null = 0 
)
protectedvirtual

Read a result item body (for BLOB columns, mostly).

Return number of successfully read bytes. Set "*is_null" to TRUE if the item is <NULL>. Throw an exception on any error.

Reimplemented from CTL_RowResult.

Definition at line 1370 of file result.cpp.

References _cs_numeric::array, buffer, CHECK_DRIVER_ERROR, CS_BIGDATETIME_TYPE, cs_dt_crack, CS_MAX_NUMLEN, CS_SUCCEED, CTLibContext::CTLIB_GetContext(), ctx, CDB_String::Data(), data, CDB_LongChar::DataSize(), _cs_daterec::datedmonth, _cs_daterec::datedweek, _cs_daterec::datedyear, _cs_daterec::datehour, _cs_daterec::dateminute, _cs_daterec::datemonth, _cs_daterec::datemsecond, _cs_daterec::datesecfrac, _cs_daterec::datesecond, _cs_daterec::datesecprec, _cs_daterec::dateyear, _cs_datetime4::days, _cs_datetime::dtdays, _cs_datetime::dttime, eDB_BigDateTime, eDB_BigInt, eDB_Binary, eDB_Bit, eDB_Char, eDB_DateTime, eDB_Double, eDB_Float, eDB_Image, eDB_Int, eDB_LongBinary, eDB_LongChar, eDB_Numeric, eDB_SmallDateTime, eDB_SmallInt, eDB_Text, eDB_TinyInt, eDB_VarBinary, eDB_VarBinaryMax, eDB_VarChar, eDB_VarCharMax, free(), CDB_DateTime::Get300Secs(), GetColumnNum(), CDB_BigDateTime::GetCTime(), CTL_Connection::GetCTLibContext(), CDB_SmallDateTime::GetDays(), CDB_DateTime::GetDays(), CDB_SmallDateTime::GetMinutes(), CDB_Object::GetType(), CDB_Object::IsNULL(), kMicroSecondsPerSecond, CTL_RowResult::m_Connect, m_CurItemNo, m_Fields, m_ReadBuffer, m_ReadBytes, malloc(), _cs_datetime4::minutes, CDB_Stream::MoveTo(), NULL, _cs_numeric::precision, CDB_Numeric::Precision(), CDB_Numeric::RawData(), CDB_Stream::Read(), _cs_numeric::scale, CDB_Numeric::Scale(), CDB_VarBinary::Size(), CDB_Binary::Size(), CDB_LongBinary::Size(), CDB_Stream::Size(), CDB_String::Size(), t, CDB_VarBinary::Value(), CDB_Binary::Value(), and CDB_LongBinary::Value().

◆ ResultType()

EDB_ResType CTL_CursorResultExpl::ResultType ( void  ) const
protectedvirtual

Get type of the result.

Reimplemented from CTL_CursorResult.

Definition at line 1233 of file result.cpp.

References eDB_CursorResult.

◆ SetResultSet()

void CTL_CursorResultExpl::SetResultSet ( CDB_Result res)
private

◆ SkipItem()

bool CTL_CursorResultExpl::SkipItem ( void  )
protectedvirtual

Skip result item.

Reimplemented from CTL_CursorResult.

Definition at line 1564 of file result.cpp.

References GetColumnNum(), and m_CurItemNo.

Friends And Related Function Documentation

◆ CTL_CursorCmdExpl

friend class CTL_CursorCmdExpl
friend

Definition at line 1332 of file interfaces.hpp.

◆ default_delete< CTL_CursorResultExpl >

friend struct default_delete< CTL_CursorResultExpl >
friend

Definition at line 1332 of file interfaces.hpp.

Member Data Documentation

◆ m_BlobDescrs

vector<I_BlobDescriptor*> CTL_CursorResultExpl::m_BlobDescrs
private

Definition at line 1381 of file interfaces.hpp.

Referenced by ClearFields(), Fetch(), and GetBlobDescriptor().

◆ m_Cmd

CTL_LangCmd* CTL_CursorResultExpl::m_Cmd
private

Definition at line 1377 of file interfaces.hpp.

Referenced by CTL_RowResult::x_GetSybaseCmd().

◆ m_CurItemNo

int CTL_CursorResultExpl::m_CurItemNo
private

Definition at line 1382 of file interfaces.hpp.

Referenced by CurrentItemNo(), Fetch(), GetItem(), ReadItem(), and SkipItem().

◆ m_CursorName

string CTL_CursorResultExpl::m_CursorName
private

Definition at line 1385 of file interfaces.hpp.

Referenced by Fetch().

◆ m_Fields

vector<CDB_Object*> CTL_CursorResultExpl::m_Fields
private

Definition at line 1380 of file interfaces.hpp.

Referenced by ClearFields(), Fetch(), GetColumnNum(), GetItem(), and ReadItem().

◆ m_ReadBuffer

void* CTL_CursorResultExpl::m_ReadBuffer
private

Definition at line 1384 of file interfaces.hpp.

Referenced by ClearFields(), and ReadItem().

◆ m_ReadBytes

size_t CTL_CursorResultExpl::m_ReadBytes
private

Definition at line 1383 of file interfaces.hpp.

Referenced by Fetch(), and ReadItem().

◆ m_Res

CDB_Result* CTL_CursorResultExpl::m_Res
private

Definition at line 1379 of file interfaces.hpp.

Referenced by Fetch(), CTL_Cmd::SetResult(), and ~CTL_CursorResultExpl().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:19 2024 by modify_doxy.py rev. 669887