OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
CSMWorld::CollectionBase Class Referenceabstract

Base class for record collections. More...

#include <collectionbase.hpp>

Inheritance diagram for CSMWorld::CollectionBase:
Collaboration diagram for CSMWorld::CollectionBase:

Public Member Functions

 CollectionBase ()
 
virtual ~CollectionBase ()
 
virtual int getSize () const =0
 
virtual std::string getId (int index) const =0
 
virtual int getIndex (const std::string &id) const =0
 
virtual int getColumns () const =0
 
virtual const ColumnBasegetColumn (int column) const =0
 
virtual QVariant getData (int index, int column) const =0
 
virtual void setData (int index, int column, const QVariant &data)=0
 
virtual void removeRows (int index, int count)=0
 < Merge modified into base. More...
 
virtual void appendBlankRecord (const std::string &id, UniversalId::Type type=UniversalId::Type_None)=0
 
virtual int searchId (const std::string &id) const =0
 
virtual void replace (int index, const RecordBase &record)=0
 
virtual void appendRecord (const RecordBase &record, UniversalId::Type type=UniversalId::Type_None)=0
 If the record type does not match, an exception is thrown. More...
 
virtual void cloneRecord (const std::string &origin, const std::string &destination, const UniversalId::Type type)=0
 
virtual const RecordBasegetRecord (const std::string &id) const =0
 
virtual const RecordBasegetRecord (int index) const =0
 
virtual int getAppendIndex (const std::string &id, UniversalId::Type type=UniversalId::Type_None) const =0
 
virtual std::vector< std::string > getIds (bool listDeleted=true) const =0
 
virtual bool reorderRows (int baseIndex, const std::vector< int > &newOrder)=0
 
int searchColumnIndex (Columns::ColumnId id) const
 Return index of column with the given id. If no such column exists, -1 is returned. More...
 
int findColumnIndex (Columns::ColumnId id) const
 

Private Member Functions

 CollectionBase (const CollectionBase &)
 
CollectionBaseoperator= (const CollectionBase &)
 

Detailed Description

Base class for record collections.

Attention
Modifying records through the interface does not update connected views. Such modifications should be done through the table model interface instead unless no views are connected to the model or special precautions have been taken to send update signals manually.

Constructor & Destructor Documentation

CSMWorld::CollectionBase::CollectionBase ( const CollectionBase )
private
CSMWorld::CollectionBase::CollectionBase ( )
CSMWorld::CollectionBase::~CollectionBase ( )
virtual

Member Function Documentation

virtual void CSMWorld::CollectionBase::appendBlankRecord ( const std::string &  id,
UniversalId::Type  type = UniversalId::Type_None 
)
pure virtual
virtual void CSMWorld::CollectionBase::appendRecord ( const RecordBase record,
UniversalId::Type  type = UniversalId::Type_None 
)
pure virtual
virtual void CSMWorld::CollectionBase::cloneRecord ( const std::string &  origin,
const std::string &  destination,
const UniversalId::Type  type 
)
pure virtual
int CSMWorld::CollectionBase::findColumnIndex ( Columns::ColumnId  id) const

Return index of column with the given id. If no such column exists, an exception is thrown.

Here is the caller graph for this function:

virtual int CSMWorld::CollectionBase::getAppendIndex ( const std::string &  id,
UniversalId::Type  type = UniversalId::Type_None 
) const
pure virtual
virtual const ColumnBase& CSMWorld::CollectionBase::getColumn ( int  column) const
pure virtual
virtual int CSMWorld::CollectionBase::getColumns ( ) const
pure virtual
virtual QVariant CSMWorld::CollectionBase::getData ( int  index,
int  column 
) const
pure virtual
virtual std::string CSMWorld::CollectionBase::getId ( int  index) const
pure virtual
virtual std::vector<std::string> CSMWorld::CollectionBase::getIds ( bool  listDeleted = true) const
pure virtual

Return a sorted collection of all IDs

Parameters
listDeletedinclude deleted record in the list

Implemented in CSMWorld::Collection< ESXRecordT, IdAccessorT >, CSMWorld::Collection< CSMWorld::Cell >, CSMWorld::Collection< CellRef >, CSMWorld::Collection< Info, IdAccessor< Info > >, CSMWorld::Collection< CSMWorld::MetaData >, and CSMWorld::RefIdCollection.

Here is the caller graph for this function:

virtual int CSMWorld::CollectionBase::getIndex ( const std::string &  id) const
pure virtual
virtual const RecordBase& CSMWorld::CollectionBase::getRecord ( const std::string &  id) const
pure virtual

Implemented in CSMWorld::Collection< ESXRecordT, IdAccessorT >, CSMWorld::Collection< CSMWorld::Cell >, CSMWorld::Collection< CellRef >, CSMWorld::Collection< Info, IdAccessor< Info > >, CSMWorld::Collection< CSMWorld::MetaData >, and CSMWorld::RefIdCollection.

Here is the caller graph for this function:

virtual const RecordBase& CSMWorld::CollectionBase::getRecord ( int  index) const
pure virtual
virtual int CSMWorld::CollectionBase::getSize ( ) const
pure virtual

Implemented in CSMWorld::Collection< ESXRecordT, IdAccessorT >, CSMWorld::Collection< CSMWorld::Cell >, CSMWorld::Collection< CellRef >, CSMWorld::Collection< Info, IdAccessor< Info > >, CSMWorld::Collection< CSMWorld::MetaData >, and CSMWorld::RefIdCollection.

Here is the caller graph for this function:

CollectionBase& CSMWorld::CollectionBase::operator= ( const CollectionBase )
private
virtual void CSMWorld::CollectionBase::removeRows ( int  index,
int  count 
)
pure virtual
virtual bool CSMWorld::CollectionBase::reorderRows ( int  baseIndex,
const std::vector< int > &  newOrder 
)
pure 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?

Implemented in CSMWorld::Collection< ESXRecordT, IdAccessorT >, CSMWorld::Collection< CSMWorld::Cell >, CSMWorld::Collection< CellRef >, CSMWorld::Collection< Info, IdAccessor< Info > >, CSMWorld::Collection< CSMWorld::MetaData >, CSMWorld::RefIdCollection, and CSMWorld::InfoCollection.

virtual void CSMWorld::CollectionBase::replace ( int  index,
const RecordBase record 
)
pure virtual

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

Attention
record must not change the ID.
Parameters
typeWill be ignored, unless the collection supports multiple record types

Implemented in CSMWorld::Collection< ESXRecordT, IdAccessorT >, CSMWorld::Collection< CSMWorld::Cell >, CSMWorld::Collection< CellRef >, CSMWorld::Collection< Info, IdAccessor< Info > >, CSMWorld::Collection< CSMWorld::MetaData >, and CSMWorld::RefIdCollection.

int CSMWorld::CollectionBase::searchColumnIndex ( Columns::ColumnId  id) const

Return index of column with the given id. If no such column exists, -1 is returned.

virtual int CSMWorld::CollectionBase::searchId ( const std::string &  id) const
pure virtual
virtual void CSMWorld::CollectionBase::setData ( int  index,
int  column,
const QVariant &  data 
)
pure virtual

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