sptk2 logo
SPTK Home Page

sptk::CMemoryDS Class Reference
[GUI Classes]

Base (memory) datasource. More...

#include <CMemoryDS.h>

Inheritance diagram for sptk::CMemoryDS:

sptk::CDataSource sptk::CDirectoryDS sptk::CFtpDS sptk::CImapDS

List of all members.

Public Member Functions

virtual ~CMemoryDS ()
 Destructor.
virtual void clear ()
 Clears all the records.
virtual const CFieldoperator[] (uint32_t fieldIndex) const
virtual CFieldoperator[] (uint32_t fieldIndex)
virtual const CFieldoperator[] (const char *fieldName) const
virtual CFieldoperator[] (const char *fieldName)
virtual void * user_data () const
 Returns user_data associated with the datasource.
virtual uint32_t fieldCount () const
virtual uint32_t recordCount () const
virtual bool readField (const char *fieldName, CVariant &fieldValue)
virtual bool writeField (const char *fieldName, const CVariant &fieldValue)
virtual bool open ()
 Opens the datasource. Implemented in derved class.
virtual bool close ()
 Closes the datasource.
virtual bool first ()
 Moves to the first record of the datasource.
virtual bool next ()
 Moves to the next record of the datasource.
virtual bool prior ()
 Moves to the prior record of the datasource.
virtual bool last ()
 Moves to the last record of the datasource.
virtual bool find (CVariant position)
 Finds the record by the record position (defined by record's user_data or key).
virtual bool eof () const
 Returns true if there are no more records in the datasource. Implemented in derved class.

Protected Member Functions

 CMemoryDS ()
 Default constructor is protected, to prevent creating of the instance of that class.

Protected Attributes

std::vector< CFieldList * > m_list
 Internal list of the dataset records.
CFieldListm_current
 Current record in the dataset.
uint32_t m_currentIndex
 The index of the current record.
bool m_eof
 EOF flag for sequentual reading first(),next()..next().


Detailed Description

Base (memory) datasource.

Class CMemoryDS implements a special case of the datasource when the data can be loaded all at once, in the datasource open() operation. It's a base class for several actual datasources.


Member Function Documentation

virtual uint32_t sptk::CMemoryDS::fieldCount (  )  const [virtual]

Returns field count in the datasource.

Returns:
field count

Implements sptk::CDataSource.

virtual CField& sptk::CMemoryDS::operator[] ( const char *  fieldName  )  [virtual]

Field access by the field name, non-const version.

Parameters:
fieldName const char *, field name
Returns:
field reference

Implements sptk::CDataSource.

virtual const CField& sptk::CMemoryDS::operator[] ( const char *  fieldName  )  const [virtual]

Field access by the field name, const version.

Parameters:
fieldName const char *, field name
Returns:
field reference

Implements sptk::CDataSource.

virtual CField& sptk::CMemoryDS::operator[] ( uint32_t  fieldIndex  )  [virtual]

Field access by the field index, non-const version.

Parameters:
fieldIndex int, field index
Returns:
field reference

Implements sptk::CDataSource.

virtual const CField& sptk::CMemoryDS::operator[] ( uint32_t  fieldIndex  )  const [virtual]

Field access by the field index, const version.

Parameters:
fieldIndex int, field index
Returns:
field reference

Implements sptk::CDataSource.

virtual bool sptk::CMemoryDS::readField ( const char *  fieldName,
CVariant fieldValue 
) [virtual]

Reads the field by name from the datasource.

Parameters:
fieldName const char *, field name
fieldValue CVariant, field value

Implements sptk::CDataSource.

virtual uint32_t sptk::CMemoryDS::recordCount (  )  const [virtual]

Returns record count in the datasource.

Returns:
record count

Implements sptk::CDataSource.

virtual bool sptk::CMemoryDS::writeField ( const char *  fieldName,
const CVariant fieldValue 
) [virtual]

Writes the field by name from the datasource.

Parameters:
fieldName const char *, field name
fieldValue CVariant, field value

Implements sptk::CDataSource.


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

Mon Mar 5 11:56:05 2012: SPTK 3.5.7