NCBI C++ ToolKit
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
impl::CCachedRowInfo Class Reference

Search Toolkit Book for impl::CCachedRowInfo

#include <dbapi/driver/impl/dbapi_driver_utils.hpp>

+ Inheritance diagram for impl::CCachedRowInfo:
+ Collaboration diagram for impl::CCachedRowInfo:

Classes

struct  SInfo
 

Public Member Functions

 CCachedRowInfo (impl::CDB_Params &bindings)
 
virtual ~CCachedRowInfo (void)
 
virtual unsigned int GetNum (void) const
 Get total number of columns in resultset. More...
 
virtual const stringGetName (const CDBParamVariant &param, CDBParamVariant::ENameFormat format=CDBParamVariant::eSQLServerName) const
 Get name of column. More...
 
virtual unsigned int GetIndex (const CDBParamVariant &param) const
 
virtual size_t GetMaxSize (const CDBParamVariant &param) const
 Get maximum size in bytes for column. More...
 
virtual EDB_Type GetDataType (const CDBParamVariant &param) const
 Get data type for column in the resultset. More...
 
virtual EDirection GetDirection (const CDBParamVariant &param) const
 Get parameter's direction (in/out/inout). More...
 
void Add (const string &name, size_t max_size, EDB_Type data_type=eDB_UnsupportedType, EDirection direction=eOut) const
 
- Public Member Functions inherited from impl::CDBBindedParams
 CDBBindedParams (impl::CDB_Params &bindings, EOwnership ownership=eNoOwnership)
 
virtual const CDB_ObjectGetValue (const CDBParamVariant &param) const
 Get value of column. More...
 
virtual CDBParamsBind (const CDBParamVariant &param, CDB_Object *value, bool out_param=false)
 This method stores pointer to data. More...
 
virtual CDBParamsSet (const CDBParamVariant &param, CDB_Object *value, bool out_param=false)
 This method stores copy of data. More...
 
virtual CDBParamsSemiShallowClone (void) const
 Yield a lightweight copy of these parameters, sharing representations for variable-length datatypes. More...
 
- Public Member Functions inherited from CDBParams
virtual ~CDBParams (void)
 

Protected Member Functions

virtual void Initialize (void) const
 
bool IsInitialized (void) const
 
void SetInitialized () const
 

Private Member Functions

unsigned int GetNumInternal (void) const
 
unsigned int FindParamPosInternal (const string &name) const
 

Private Attributes

bool m_Initialized
 
vector< SInfom_Info
 

Additional Inherited Members

- Public Types inherited from CDBParams
enum  EDirection { eIn , eOut , eInOut }
 

Detailed Description

Definition at line 140 of file dbapi_driver_utils.hpp.

Constructor & Destructor Documentation

◆ CCachedRowInfo()

impl::CCachedRowInfo::CCachedRowInfo ( impl::CDB_Params bindings)

Definition at line 263 of file dbapi_driver_utils.cpp.

◆ ~CCachedRowInfo()

impl::CCachedRowInfo::~CCachedRowInfo ( void  )
virtual

Definition at line 269 of file dbapi_driver_utils.cpp.

Member Function Documentation

◆ Add()

void impl::CCachedRowInfo::Add ( const string name,
size_t  max_size,
EDB_Type  data_type = eDB_UnsupportedType,
EDirection  direction = eOut 
) const
inline

◆ FindParamPosInternal()

unsigned int impl::CCachedRowInfo::FindParamPosInternal ( const string name) const
private

◆ GetDataType()

EDB_Type impl::CCachedRowInfo::GetDataType ( const CDBParamVariant param) const
virtual

Get data type for column in the resultset.

Parameters
paramColumn number or name

Reimplemented from impl::CDBBindedParams.

Definition at line 366 of file dbapi_driver_utils.cpp.

References eDB_UnsupportedType, FindParamPosInternal(), CDBParamVariant::GetName(), GetNumInternal(), CDBParamVariant::GetPosition(), Initialize(), IsInitialized(), CDBParamVariant::IsPositional(), and m_Info.

◆ GetDirection()

CDBParams::EDirection impl::CCachedRowInfo::GetDirection ( const CDBParamVariant param) const
virtual

Get parameter's direction (in/out/inout).

Parameters
paramColumn number or name

Reimplemented from impl::CDBBindedParams.

Definition at line 386 of file dbapi_driver_utils.cpp.

References CDBParams::eOut, FindParamPosInternal(), CDBParamVariant::GetName(), GetNumInternal(), CDBParamVariant::GetPosition(), Initialize(), IsInitialized(), CDBParamVariant::IsPositional(), and m_Info.

◆ GetIndex()

unsigned int impl::CCachedRowInfo::GetIndex ( const CDBParamVariant param) const
virtual
Parameters
paramColumn number or name
Returns
Number of a columnn, which is corresponding to a name.

Reimplemented from impl::CDBBindedParams.

Definition at line 327 of file dbapi_driver_utils.cpp.

References DATABASE_DRIVER_ERROR, FindParamPosInternal(), CDBParamVariant::GetName(), CDBParamVariant::GetPosition(), Initialize(), IsInitialized(), and CDBParamVariant::IsPositional().

◆ GetMaxSize()

size_t impl::CCachedRowInfo::GetMaxSize ( const CDBParamVariant param) const
virtual

Get maximum size in bytes for column.

Parameters
colColumn number or name
Returns
Max number of bytes needed to hold the returned data.

Reimplemented from impl::CDBBindedParams.

Definition at line 346 of file dbapi_driver_utils.cpp.

References FindParamPosInternal(), CDBParamVariant::GetName(), GetNumInternal(), CDBParamVariant::GetPosition(), Initialize(), IsInitialized(), CDBParamVariant::IsPositional(), and m_Info.

◆ GetName()

const string & impl::CCachedRowInfo::GetName ( const CDBParamVariant param,
CDBParamVariant::ENameFormat  format = CDBParamVariant::eSQLServerName 
) const
virtual

Get name of column.

This method is returning const reference because meta-info MUST be cached for performance reasons.

Parameters
paramColumn number or name

Reimplemented from impl::CDBBindedParams.

Definition at line 304 of file dbapi_driver_utils.cpp.

References FindParamPosInternal(), format, CDBParamVariant::GetName(), GetNumInternal(), CDBParamVariant::GetPosition(), Initialize(), IsInitialized(), CDBParamVariant::IsPositional(), kEmptyStr, and m_Info.

◆ GetNum()

unsigned int impl::CCachedRowInfo::GetNum ( void  ) const
virtual

Get total number of columns in resultset.

Returns
total number of columns in resultset

Reimplemented from impl::CDBBindedParams.

Definition at line 275 of file dbapi_driver_utils.cpp.

References GetNumInternal(), Initialize(), and IsInitialized().

◆ GetNumInternal()

unsigned int impl::CCachedRowInfo::GetNumInternal ( void  ) const
inlineprivate

Definition at line 185 of file dbapi_driver_utils.hpp.

References m_Info.

Referenced by GetDataType(), GetDirection(), GetMaxSize(), GetName(), and GetNum().

◆ Initialize()

virtual void impl::CCachedRowInfo::Initialize ( void  ) const
inlineprotectedvirtual

◆ IsInitialized()

bool impl::CCachedRowInfo::IsInitialized ( void  ) const
inlineprotected

◆ SetInitialized()

void impl::CCachedRowInfo::SetInitialized ( ) const
inlineprotected

Definition at line 178 of file dbapi_driver_utils.hpp.

References m_Initialized.

Referenced by Add(), Initialize(), and impl::CRowInfo_SP_SQL_Server::Initialize().

Member Data Documentation

◆ m_Info

vector<SInfo> impl::CCachedRowInfo::m_Info
mutableprivate

◆ m_Initialized

bool impl::CCachedRowInfo::m_Initialized
mutableprivate

Definition at line 208 of file dbapi_driver_utils.hpp.

Referenced by IsInitialized(), and SetInitialized().


The documentation for this class was generated from the following files:
Modified on Wed Apr 24 14:09:58 2024 by modify_doxy.py rev. 669887