Base (memory) datasource. More...
#include <MemoryDS.h>
Public Member Functions | |
MemoryDS ()=default | |
MemoryDS (const MemoryDS &other)=delete | |
MemoryDS (MemoryDS &&other) noexcept | |
MemoryDS & | operator= (const MemoryDS &other)=delete |
MemoryDS & | operator= (MemoryDS &&other) noexcept |
virtual void | clear () |
virtual FieldList & | current () |
Field & | operator[] (size_t fieldIndex) override |
Field & | operator[] (const String &fieldName) override |
size_t | fieldCount () const override |
size_t | recordCount () const override |
bool | readField (const char *fieldName, Variant &fieldValue) override |
bool | writeField (const char *fieldName, const Variant &fieldValue) override |
bool | open () override |
bool | close () override |
bool | first () override |
bool | next () override |
bool | prior () override |
bool | last () override |
bool | find (const String &fieldName, const Variant &position) override |
bool | eof () const override |
bool | empty () const |
std::list< FieldList > & | rows () |
const std::list< FieldList > & | rows () const |
void | push_back (FieldList &&fieldList) |
Public Member Functions inherited from sptk::DataSource | |
DataSource ()=default | |
virtual | ~DataSource ()=default |
virtual Field & | operator[] (size_t fieldIndex)=0 |
virtual Field & | operator[] (const String &fieldName)=0 |
virtual size_t | fieldCount () const =0 |
virtual size_t | recordCount () const =0 |
virtual bool | readField (const char *fieldName, Variant &fieldValue)=0 |
virtual bool | writeField (const char *fieldName, const Variant &fieldValue)=0 |
virtual bool | open () |
virtual bool | close () |
virtual bool | first () |
virtual bool | next () |
virtual bool | prior () |
virtual bool | last () |
virtual bool | find (const String &, const Variant &) |
virtual bool | eof () const |
bool | load () |
bool | save () |
void | exportRowTo (const xdoc::SNode &node, bool compactXmlMode, bool nullLargeData=false) |
virtual void | exportTo (xdoc::Node &parentNode, const String &nodeName, bool compactXmlMode) |
Additional Inherited Members | |
Protected Member Functions inherited from sptk::DataSource | |
virtual bool | loadData () |
virtual bool | saveData () |
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.
|
default |
Default constructor
|
delete |
Deleted copy constructor
other | Other object |
|
inlinenoexcept |
Move constructor
other | Other object |
|
virtual |
Clears all the records
|
overridevirtual |
Closes the datasource.
Reimplemented from sptk::DataSource.
|
inlinevirtual |
Get current record
|
inlineoverridevirtual |
Returns true if there are no more records in the datasource. Implemented in derved class.
Reimplemented from sptk::DataSource.
|
overridevirtual |
Finds the record by the record position (defined by record's user_data or key).
Reimplemented from sptk::DataSource.
|
overridevirtual |
Moves to the first record of the datasource.
Reimplemented from sptk::DataSource.
|
overridevirtual |
Moves to the last record of the datasource.
Reimplemented from sptk::DataSource.
|
overridevirtual |
Moves to the next record of the datasource.
Reimplemented from sptk::DataSource.
|
overridevirtual |
Opens the datasource. Implemented in derved class.
Reimplemented from sptk::DataSource.
Reimplemented in sptk::ImapDS.
Deleted copy assignment
other | Other object |
Move assignment
other | Other object |
Field access by the field name, non-const version.
fieldName | const char *, field name |
Implements sptk::DataSource.
|
overridevirtual |
Field access by the field index, const version.
fieldIndex | int, field index |
Implements sptk::DataSource.
|
overridevirtual |
Moves to the prior record of the datasource.
Reimplemented from sptk::DataSource.
void sptk::MemoryDS::push_back | ( | FieldList && | fieldList | ) |
Push back field list. Memory DS takes ownership of the data
fieldList | Field list |
|
overridevirtual |
Reads the field by name from the datasource.
fieldName | const char *, field name |
fieldValue | CVariant, field value |
Implements sptk::DataSource.
|
overridevirtual |
|
overridevirtual |
Writes the field by name from the datasource.
fieldName | const char *, field name |
fieldValue | CVariant, field value |
Implements sptk::DataSource.