I_Result Class Reference
[Database Server Interfaces]

Search Toolkit Book for I_Result

#include <interfaces.hpp>

Inheritance diagram for I_Result:

Inheritance graph
[legend]
List of all members.

Detailed Description

I_Result::.

Definition at line 574 of file interfaces.hpp.

Public Types

enum  EGetItem { eAppendLOB, eAssignLOB }

Public Member Functions

 I_Result (void)
virtual ~I_Result (void)
virtual EDB_ResType ResultType (void) const =0
 Get type of the result.
virtual const CDBParamsGetDefineParams (void) const =0
 Get meta-information about rows in resultset.
virtual unsigned int NofItems (void) const =0
 Get # of items (columns) in the result

Get # of items (columns) in the result.

virtual const char * ItemName (unsigned int item_num) const =0
 Get name of a result item.
virtual size_t ItemMaxSize (unsigned int item_num) const =0
 Get size (in bytes) of a result item.
virtual EDB_Type ItemDataType (unsigned int item_num) const =0
 Get datatype of a result item.
virtual bool Fetch (void)=0
 Fetch next row.
virtual int CurrentItemNo (void) const =0
 Return current item number we can retrieve (0,1,.
virtual int GetColumnNum (void) const =0
 Return number of columns in the recordset.
virtual CDB_ObjectGetItem (CDB_Object *item_buf=0, EGetItem policy=eAppendLOB)=0
 Get a result item (you can use either GetItem or ReadItem).
virtual size_t ReadItem (void *buffer, size_t buffer_size, bool *is_null=0)=0
 Read a result item body (for text/image mostly).
virtual I_ITDescriptorGetImageOrTextDescriptor (void)=0
 Get a descriptor for text/image column (for SendData).
virtual bool SkipItem (void)=0
 Skip result item.


Member Enumeration Documentation

enum I_Result::EGetItem
 

Enumerator:
eAppendLOB 
eAssignLOB 

Definition at line 581 of file interfaces.hpp.


Constructor & Destructor Documentation

I_Result::I_Result void   ) 
 

Definition at line 252 of file interfaces.cpp.

I_Result::~I_Result void   )  [virtual]
 

Definition at line 256 of file interfaces.cpp.


Member Function Documentation

virtual int I_Result::CurrentItemNo void   )  const [pure virtual]
 

Return current item number we can retrieve (0,1,.

..)

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

Implemented in CDB_Result.

virtual bool I_Result::Fetch void   )  [pure virtual]
 

Fetch next row.

Returns:
  • true if a record was fetched.
  • false if no more record can be fetched.

Implemented in CDB_Result.

virtual int I_Result::GetColumnNum void   )  const [pure virtual]
 

Return number of columns in the recordset.

Returns:
number of columns in the recordset.

Implemented in CDB_Result.

virtual const CDBParams& I_Result::GetDefineParams void   )  const [pure virtual]
 

Get meta-information about rows in resultset.

Implemented in CDB_Result.

virtual I_ITDescriptor* I_Result::GetImageOrTextDescriptor void   )  [pure virtual]
 

Get a descriptor for text/image column (for SendData).

Returns:
Return NULL if this result doesn't (or can't) have img/text descriptor.
Note:
You need to call ReadItem (maybe even with buffer_size == 0) before calling this method!

Implemented in CDB_Result.

virtual CDB_Object* I_Result::GetItem CDB_Object item_buf = 0,
EGetItem  policy = eAppendLOB
[pure virtual]
 

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

Parameters:
item_buf 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". In case of "CDB_Image" and "CDB_Text" data types value will be *appended* to the "item_buf" by default (policy == eAppendLOB).
policy Data retrieval policy. If policy == eAppendLOB and "item_buf" is an object of CDB_Image or CDB_Text type, then data will be *appended* to the end of previously assigned data. If policy == eAssignLOB and "item_buf" is an object of CDB_Image or CDB_Text type, then new value will be *assigned* to the "item_buf" object.
Returns:
a result item
See also:
ReadItem, SkipItem

virtual EDB_Type I_Result::ItemDataType unsigned int  item_num  )  const [pure virtual]
 

Get datatype of a result item.

Parameters:
item_num Number of item, starting from 0.
Returns:
Return 'eDB_UnsupportedType' if "item_num" >= NofItems().

Implemented in CDB_Result.

virtual size_t I_Result::ItemMaxSize unsigned int  item_num  )  const [pure virtual]
 

Get size (in bytes) of a result item.

Parameters:
item_num Number of item, starting from 0.
Returns:
Return zero if "item_num" >= NofItems().

Implemented in CDB_Result.

virtual const char* I_Result::ItemName unsigned int  item_num  )  const [pure virtual]
 

Get name of a result item.

Parameters:
item_num Number of item, starting from 0.
Returns:
NULL if "item_num" >= NofItems(), otherwise item name.

Implemented in CDB_Result.

virtual unsigned int I_Result::NofItems void   )  const [pure virtual]
 

Get # of items (columns) in the result

Get # of items (columns) in the result.

Returns:
Number of items (columns) in the result.

Implemented in CDB_Result.

virtual size_t I_Result::ReadItem void *  buffer,
size_t  buffer_size,
bool is_null = 0
[pure virtual]
 

Read a result item body (for text/image mostly).

Throw an exception on any error.

Parameters:
buffer Buffer to fill with data.
buffer_size Buffere size.
is_null Set "*is_null" to TRUE if the item is <NULL>.
Returns:
number of successfully read bytes.
See also:
GetItem, SkipItem

Implemented in CDB_Result.

virtual EDB_ResType I_Result::ResultType void   )  const [pure virtual]
 

Get type of the result.

Returns:
Result type

Implemented in CDB_Result.

virtual bool I_Result::SkipItem void   )  [pure virtual]
 

Skip result item.

Returns:
TRUE on success.
See also:
GetItem, ReadItem

Implemented in CDB_Result.


The documentation for this class was generated from the following files:
Generated on Wed Dec 9 08:12:41 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:20:12 2009 by modify_doxy.py rev. 173732