OpenMW
Public Member Functions | Private Member Functions | Private Attributes
CSMWorld::RefIdCollection Class Reference

#include <refidcollection.hpp>

List of all members.

Public Member Functions

 RefIdCollection ()
virtual ~RefIdCollection ()
virtual int getSize () const
virtual std::string getId (int index) const
virtual int getIndex (const std::string &id) const
virtual int getColumns () const
virtual const ColumnBasegetColumn (int column) const
virtual QVariant getData (int index, int column) const
virtual void setData (int index, int column, const QVariant &data)
virtual void removeRows (int index, int count)
 < Merge modified into base.
virtual void appendBlankRecord (const std::string &id, UniversalId::Type type)
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)
virtual const RecordBasegetRecord (const std::string &id) const
virtual const RecordBasegetRecord (int index) const
void load (ESM::ESMReader &reader, bool base, UniversalId::Type type)
virtual int getAppendIndex (const std::string &id, UniversalId::Type type) const
virtual std::vector< std::string > getIds (bool listDeleted) const
virtual bool reorderRows (int baseIndex, const std::vector< int > &newOrder)
void save (int index, ESM::ESMWriter &writer) const

Private Member Functions

const RefIdAdapterfindAdaptor (UniversalId::Type) const
 Throws an exception if no adaptor for Type can be found.

Private Attributes

RefIdData mData
std::deque< RefIdColumnmColumns
std::map< UniversalId::Type,
RefIdAdapter * > 
mAdapters

Constructor & Destructor Documentation


Member Function Documentation

void CSMWorld::RefIdCollection::appendBlankRecord ( const std::string &  id,
UniversalId::Type  type 
) [virtual]
Parameters:
typeWill be ignored, unless the collection supports multiple record types

Implements CSMWorld::CollectionBase.

void CSMWorld::RefIdCollection::appendRecord ( const RecordBase record,
UniversalId::Type  type 
) [virtual]

If the record type does not match, an exception is thrown.

Parameters:
typeWill be ignored, unless the collection supports multiple record types

Implements CSMWorld::CollectionBase.

Throws an exception if no adaptor for Type can be found.

int CSMWorld::RefIdCollection::getAppendIndex ( const std::string &  id,
UniversalId::Type  type 
) const [virtual]
Parameters:
typeWill be ignored, unless the collection supports multiple record types

Implements CSMWorld::CollectionBase.

const CSMWorld::ColumnBase & CSMWorld::RefIdCollection::getColumn ( int  column) const [virtual]
int CSMWorld::RefIdCollection::getColumns ( ) const [virtual]
QVariant CSMWorld::RefIdCollection::getData ( int  index,
int  column 
) const [virtual]
std::string CSMWorld::RefIdCollection::getId ( int  index) const [virtual]
std::vector< std::string > CSMWorld::RefIdCollection::getIds ( bool  listDeleted) const [virtual]

Return a sorted collection of all IDs

Parameters:
listDeletedinclude deleted record in the list

Implements CSMWorld::CollectionBase.

int CSMWorld::RefIdCollection::getIndex ( const std::string &  id) const [virtual]
const CSMWorld::RecordBase & CSMWorld::RefIdCollection::getRecord ( const std::string &  id) const [virtual]
const CSMWorld::RecordBase & CSMWorld::RefIdCollection::getRecord ( int  index) const [virtual]
int CSMWorld::RefIdCollection::getSize ( ) const [virtual]
void CSMWorld::RefIdCollection::load ( ESM::ESMReader reader,
bool  base,
UniversalId::Type  type 
)
Todo:
report the problem to the user
void CSMWorld::RefIdCollection::removeRows ( int  index,
int  count 
) [virtual]

< Merge modified into base.

< Remove records that are flagged as erased.

Implements CSMWorld::CollectionBase.

bool CSMWorld::RefIdCollection::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).

Returns:
Success?

Implements CSMWorld::CollectionBase.

void CSMWorld::RefIdCollection::replace ( int  index,
const RecordBase record 
) [virtual]

If the record type does not match, an exception is thrown.

Attention:
record must not change the ID.

Implements CSMWorld::CollectionBase.

void CSMWorld::RefIdCollection::save ( int  index,
ESM::ESMWriter writer 
) const
int CSMWorld::RefIdCollection::searchId ( const std::string &  id) const [virtual]

Search record with id.

Returns:
index of record (if found) or -1 (not found)

Implements CSMWorld::CollectionBase.

void CSMWorld::RefIdCollection::setData ( int  index,
int  column,
const QVariant &  data 
) [virtual]

Member Data Documentation


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