OpenMW
|
Single-type record collection. More...
#include <collection.hpp>
Public Member Functions | |
Collection () | |
virtual | ~Collection () |
void | add (const ESXRecordT &record) |
Add a new record (modified) | |
virtual int | getSize () const |
virtual std::string | getId (int index) const |
virtual int | getIndex (const std::string &id) const |
virtual int | getColumns () const |
virtual QVariant | getData (int index, int column) const |
virtual void | setData (int index, int column, const QVariant &data) |
virtual const ColumnBase & | getColumn (int column) const |
virtual void | merge () |
Merge modified into base. | |
virtual void | purge () |
Remove records that are flagged as erased. | |
virtual void | removeRows (int index, int count) |
< Merge modified into base. | |
virtual void | appendBlankRecord (const std::string &id, UniversalId::Type type=UniversalId::Type_None) |
virtual int | searchId (const std::string &id) const |
virtual void | replace (int index, const RecordBase &record) |
virtual void | appendRecord (const RecordBase &record, UniversalId::Type type=UniversalId::Type_None) |
virtual const Record < ESXRecordT > & | getRecord (const std::string &id) const |
virtual const Record < ESXRecordT > & | getRecord (int index) const |
virtual int | getAppendIndex (const std::string &id, UniversalId::Type type=UniversalId::Type_None) const |
virtual std::vector< std::string > | getIds (bool listDeleted=true) const |
virtual void | insertRecord (const RecordBase &record, int index, UniversalId::Type type=UniversalId::Type_None) |
virtual bool | reorderRows (int baseIndex, const std::vector< int > &newOrder) |
void | addColumn (Column< ESXRecordT > *column) |
void | setRecord (int index, const Record< ESXRecordT > &record) |
Protected Member Functions | |
const std::map< std::string, int > & | getIdMap () const |
const std::vector< Record < ESXRecordT > > & | getRecords () const |
bool | reorderRowsImp (int baseIndex, const std::vector< int > &newOrder) |
Private Member Functions | |
Collection (const Collection &) | |
Collection & | operator= (const Collection &) |
Private Attributes | |
std::vector< Record< ESXRecordT > > | mRecords |
std::map< std::string, int > | mIndex |
std::vector< Column < ESXRecordT > * > | mColumns |
Single-type record collection.
CSMWorld::Collection< ESXRecordT, IdAccessorT >::Collection | ( | const Collection< ESXRecordT, IdAccessorT > & | ) | [private] |
CSMWorld::Collection< ESXRecordT, IdAccessorT >::Collection | ( | ) |
CSMWorld::Collection< ESXRecordT, IdAccessorT >::~Collection | ( | ) | [virtual] |
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::add | ( | const ESXRecordT & | record | ) |
Add a new record (modified)
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::addColumn | ( | Column< ESXRecordT > * | column | ) |
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::appendBlankRecord | ( | const std::string & | id, |
UniversalId::Type | type = UniversalId::Type_None |
||
) | [virtual] |
type | Will be ignored, unless the collection supports multiple record types |
Implements CSMWorld::CollectionBase.
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::appendRecord | ( | const RecordBase & | record, |
UniversalId::Type | type = UniversalId::Type_None |
||
) | [virtual] |
If the record type does not match, an exception is thrown.
type | Will be ignored, unless the collection supports multiple record types |
Implements CSMWorld::CollectionBase.
int CSMWorld::Collection< ESXRecordT, IdAccessorT >::getAppendIndex | ( | const std::string & | id, |
UniversalId::Type | type = UniversalId::Type_None |
||
) | const [virtual] |
type | Will be ignored, unless the collection supports multiple record types |
Implements CSMWorld::CollectionBase.
Reimplemented in CSMWorld::InfoCollection.
const ColumnBase & CSMWorld::Collection< ESXRecordT, IdAccessorT >::getColumn | ( | int | column | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
int CSMWorld::Collection< ESXRecordT, IdAccessorT >::getColumns | ( | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
QVariant CSMWorld::Collection< ESXRecordT, IdAccessorT >::getData | ( | int | index, |
int | column | ||
) | const [virtual] |
Implements CSMWorld::CollectionBase.
std::string CSMWorld::Collection< ESXRecordT, IdAccessorT >::getId | ( | int | index | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
const std::map< std::string, int > & CSMWorld::Collection< ESXRecordT, IdAccessorT >::getIdMap | ( | ) | const [protected] |
std::vector< std::string > CSMWorld::Collection< ESXRecordT, IdAccessorT >::getIds | ( | bool | listDeleted = true | ) | const [virtual] |
Return a sorted collection of all IDs
listDeleted | include deleted record in the list |
Implements CSMWorld::CollectionBase.
int CSMWorld::Collection< ESXRecordT, IdAccessorT >::getIndex | ( | const std::string & | id | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
const Record< ESXRecordT > & CSMWorld::Collection< ESXRecordT, IdAccessorT >::getRecord | ( | const std::string & | id | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
const Record< ESXRecordT > & CSMWorld::Collection< ESXRecordT, IdAccessorT >::getRecord | ( | int | index | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
const std::vector< Record< ESXRecordT > > & CSMWorld::Collection< ESXRecordT, IdAccessorT >::getRecords | ( | ) | const [protected] |
int CSMWorld::Collection< ESXRecordT, IdAccessorT >::getSize | ( | ) | const [virtual] |
Implements CSMWorld::CollectionBase.
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::insertRecord | ( | const RecordBase & | record, |
int | index, | ||
UniversalId::Type | type = UniversalId::Type_None |
||
) | [virtual] |
Insert record before index.
If the record type does not match, an exception is thrown.
If the index is invalid either generally (by being out of range) or for the particular record, an exception is thrown.
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::merge | ( | ) | [virtual] |
Merge modified into base.
Collection& CSMWorld::Collection< ESXRecordT, IdAccessorT >::operator= | ( | const Collection< ESXRecordT, IdAccessorT > & | ) | [private] |
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::purge | ( | ) | [virtual] |
Remove records that are flagged as erased.
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::removeRows | ( | int | index, |
int | count | ||
) | [virtual] |
< Merge modified into base.
< Remove records that are flagged as erased.
Implements CSMWorld::CollectionBase.
bool CSMWorld::Collection< ESXRecordT, IdAccessorT >::reorderRows | ( | int | baseIndex, |
const std::vector< int > & | newOrder | ||
) | [virtual] |
Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices given in newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
Implements CSMWorld::CollectionBase.
Reimplemented in CSMWorld::InfoCollection.
bool CSMWorld::Collection< ESXRecordT, IdAccessorT >::reorderRowsImp | ( | int | baseIndex, |
const std::vector< int > & | newOrder | ||
) | [protected] |
Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices given in newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::replace | ( | int | index, |
const RecordBase & | record | ||
) | [virtual] |
If the record type does not match, an exception is thrown.
Implements CSMWorld::CollectionBase.
int CSMWorld::Collection< ESXRecordT, IdAccessorT >::searchId | ( | const std::string & | id | ) | const [virtual] |
Search record with id.
Implements CSMWorld::CollectionBase.
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::setData | ( | int | index, |
int | column, | ||
const QVariant & | data | ||
) | [virtual] |
Implements CSMWorld::CollectionBase.
void CSMWorld::Collection< ESXRecordT, IdAccessorT >::setRecord | ( | int | index, |
const Record< ESXRecordT > & | record | ||
) |
std::vector<Column<ESXRecordT> *> CSMWorld::Collection< ESXRecordT, IdAccessorT >::mColumns [private] |
std::map<std::string, int> CSMWorld::Collection< ESXRecordT, IdAccessorT >::mIndex [private] |
std::vector<Record<ESXRecordT> > CSMWorld::Collection< ESXRecordT, IdAccessorT >::mRecords [private] |