All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HSEPDataSqLite::SqLiteResultSet Class Reference

SqLite DBResultSet implementation. More...

#include <DBSqLite.h>

+ Inheritance diagram for HSEPDataSqLite::SqLiteResultSet:
+ Collaboration diagram for HSEPDataSqLite::SqLiteResultSet:

Public Member Functions

 SqLiteResultSet ()
 
virtual ~SqLiteResultSet ()
 
virtual int forEach (CycleBase &pCycle)
 Batch operation using a CycleBase of derived class.
 
virtual int forEach (ExecuteFunctionType pFunction)
 Batch operation using a stateless function.
 
string getString (string &pNameRef)
 Returns the value associated to the provided pNameRef key.
 
string getString (int pPosition)
 Returns the value located in the pPosition order within the provided query.
 
size_t size ()
 The quantity of stored rows.
 
bool isLast ()
 When traversing the data set, indicates if there are more rows to read.
 
void getMetadata (DBMetadata &pMetadataRef)
 Fills the provided pMetadataRef instance with the query specific metadata values.
 
- Public Member Functions inherited from HSEPData::DBResultSet
 DBResultSet ()
 
virtual ~DBResultSet ()
 
virtual string getString (const char *pName)
 Returns the value associated to the provided pName key.
 
virtual void destroyMetadata (DBMetadata &pMetadataRef)
 Given the pMetadataRef, releases the previously returned metadata values.
 
- Public Member Functions inherited from HSEP::HSEPObject
string & lastErrorRef ()
 Returns a reference to the last stored error message.
 
ErrorCode lastCode ()
 Returns the last stored code.
 
bool valid ()
 Permits to know if the object has a valid internal state.
 
string & typeRef ()
 Permits to know the type of this particular object.
 

Friends

class SqLiteStatement
 

Additional Inherited Members

- Protected Member Functions inherited from HSEP::HSEPObject
 HSEPObject (const char *pType)
 Constructor, providing the base for the state controlling instance.
 
virtual ~HSEPObject ()
 
void setLastError (string &pErrorMsgRef)
 Assigns an error message text to the last executed operation.
 
void setLastError (const string &pErrorMsgRef)
 Assigns an error message text to the last executed operation.
 
void setLastError (const char *pErrorMsg)
 Assigns an error message text to the last executed operation.
 
void setValid ()
 Defines that the object has a valid state.
 
void setInvalid ()
 Defines that the object has an invalid state.
 
void setLastCode (const ErrorCode pErrorCode)
 Defines the internal result code for the object.
 

Detailed Description

SqLite DBResultSet implementation.

Definition at line 46 of file DBSqLite.h.

Constructor & Destructor Documentation

HSEPDataSqLite::SqLiteResultSet::SqLiteResultSet ( )

Definition at line 175 of file DBSqLite.cpp.

HSEPDataSqLite::SqLiteResultSet::~SqLiteResultSet ( )
virtual

Definition at line 179 of file DBSqLite.cpp.

Member Function Documentation

int HSEPDataSqLite::SqLiteResultSet::forEach ( CycleBase pCycleRef)
virtual

Batch operation using a CycleBase of derived class.

Parameters
pCycleRef
Returns
the quantity of times the CycleBase::execute function returned true.

Implements HSEPData::DBResultSet.

Definition at line 205 of file DBSqLite.cpp.

References HSEPData::CycleBase::execute(), HSEP::Array< T >::forEach(), HSEPDataSqLite::SQLResultData::isFirst(), HSEPDataSqLite::SQLResultData::isLast(), HSEPDataSqLite::SQLResultData::next(), and HSEPDataSqLite::SQLResultData::table().

+ Here is the call graph for this function:

int HSEPDataSqLite::SqLiteResultSet::forEach ( ExecuteFunctionType  pFunction)
virtual

Batch operation using a stateless function.

When using a lambda function it is possible to "capture" surrounding variables, that would permit to the reentrant lambda function to perform state-related operations very similar to what a Cycle will do. However, when the complexity is high, it is recomended to use a particular Cycle type instead.

Parameters
pFunction
Returns
the quantity of times the provided function returned true.

Implements HSEPData::DBResultSet.

Definition at line 222 of file DBSqLite.cpp.

References HSEP::Array< T >::forEach(), HSEPDataSqLite::SQLResultData::isFirst(), HSEPDataSqLite::SQLResultData::isLast(), HSEPDataSqLite::SQLResultData::next(), and HSEPDataSqLite::SQLResultData::table().

+ Here is the call graph for this function:

void HSEPDataSqLite::SqLiteResultSet::getMetadata ( DBMetadata pMetadataRef)
virtual

Fills the provided pMetadataRef instance with the query specific metadata values.

It is very important that when the metadata won't be used anymore, a destroyMetadata be performed for not to produce memory leaks.

Parameters
pMetadataRef

Implements HSEPData::DBResultSet.

Definition at line 197 of file DBSqLite.cpp.

References HSEPDataSqLite::SQLResultData::getMetadata().

+ Here is the call graph for this function:

string HSEPDataSqLite::SqLiteResultSet::getString ( string &  pNameRef)
virtual

Returns the value associated to the provided pNameRef key.

Parameters
pNameRef
Returns

Implements HSEPData::DBResultSet.

Definition at line 239 of file DBSqLite.cpp.

References HSEPDataSqLite::SQLResultData::getString().

+ Here is the call graph for this function:

string HSEPDataSqLite::SqLiteResultSet::getString ( int  pPosition)
virtual

Returns the value located in the pPosition order within the provided query.

Parameters
pPosition
Returns

Implements HSEPData::DBResultSet.

Definition at line 249 of file DBSqLite.cpp.

References HSEPDataSqLite::SQLResultData::getString().

+ Here is the call graph for this function:

bool HSEPDataSqLite::SqLiteResultSet::isLast ( )
virtual

When traversing the data set, indicates if there are more rows to read.

Returns
false when it is not the last row in the data set.

Implements HSEPData::DBResultSet.

Definition at line 184 of file DBSqLite.cpp.

size_t HSEPDataSqLite::SqLiteResultSet::size ( )
virtual

The quantity of stored rows.

Returns

Implements HSEPData::DBResultSet.

Definition at line 191 of file DBSqLite.cpp.

Friends And Related Function Documentation

friend class SqLiteStatement
friend

Definition at line 63 of file DBSqLite.h.


The documentation for this class was generated from the following files: