![]() |
Mapper
0.9.0
API documentation
|
A template class for dealing with OCD entity indices. More...
#include <ocd_types.h>
Classes | |
struct | value_type |
Public Types | |
using | FileFormat = F |
The actual file format version type, reexported. More... | |
using | EntityType = T |
The actual entity type. More... | |
using | EntryType = typename T::IndexEntryType |
The index entry type for the entity type. More... | |
using | IndexBlock = Ocd::IndexBlock< EntryType > |
The index block type. More... | |
using | const_iterator = OcdEntityIndexIterator< value_type > |
The index iterator type. More... | |
Public Member Functions | |
OcdEntityIndex (OcdFile< F > &file) noexcept | |
Constructs an entity index object. More... | |
OcdEntityIndex (const OcdEntityIndex &)=delete | |
OcdEntityIndex & | operator= (const OcdEntityIndex &)=delete |
~OcdEntityIndex ()=default | |
Destroys the object. More... | |
const_iterator | begin () const |
Returns a forward iterator to the beginning of the index. More... | |
const_iterator | end () const noexcept |
Returns a forward iterator to the end. More... | |
EntryType & | insert (const QByteArray &entity_data, const EntryType &entry) |
Inserts an object with the given entry prototype. More... | |
EntryType & | insert (const QByteArray &entity_data) |
Inserts a symbol. More... | |
EntryType & | insert (qint32 string_type, const QByteArray &string_data) |
Inserts a parameter string with the given type number. More... | |
A template class for dealing with OCD entity indices.
Instances of this data do not actually copy any data, but rather provide an STL container like interface for raw data. The interfaces allows for forward iterating over the index for the given entity type.
F | the type defining the file format version type |
T | the entity type (string, symbol, object) |
using OcdEntityIndex< F, T >::const_iterator = OcdEntityIndexIterator<value_type> |
The index iterator type.
using OcdEntityIndex< F, T >::EntityType = T |
The actual entity type.
using OcdEntityIndex< F, T >::EntryType = typename T::IndexEntryType |
The index entry type for the entity type.
using OcdEntityIndex< F, T >::FileFormat = F |
The actual file format version type, reexported.
using OcdEntityIndex< F, T >::IndexBlock = Ocd::IndexBlock<EntryType> |
The index block type.
|
noexcept |
Constructs an entity index object.
|
delete |
|
default |
Destroys the object.
OcdEntityIndex< F, T >::const_iterator OcdEntityIndex< F, T >::begin | ( | ) | const |
Returns a forward iterator to the beginning of the index.
|
noexcept |
Returns a forward iterator to the end.
OcdEntityIndex< F, T >::EntryType & OcdEntityIndex< F, T >::insert | ( | const QByteArray & | entity_data, |
const EntryType & | entry | ||
) |
Inserts an object with the given entry prototype.
In order to update the create index entry after insertion, pay attention to capture the result as reference, not as copy:
auto& object_entry = object_index.insert(ocd_object, prototype);
OcdEntityIndex< F, T >::EntryType & OcdEntityIndex< F, T >::insert | ( | const QByteArray & | entity_data | ) |
Inserts a symbol.
OcdEntityIndex< F, T >::EntryType & OcdEntityIndex< F, T >::insert | ( | qint32 | string_type, |
const QByteArray & | string_data | ||
) |
Inserts a parameter string with the given type number.
The string_data is expected to have the trailing '\0' maintained by QByteArray at size(), i.e. it must not be constructed using QByteArray::fromRawData().
|
delete |