1 #ifndef OPENMW_MWWORLD_STORE_H
2 #define OPENMW_MWWORLD_STORE_H
27 RecordId(
const std::string &
id =
"",
bool isDeleted =
false);
40 virtual size_t getSize()
const = 0;
44 virtual bool eraseStatic(
const std::string &
id) {
return false;}
57 typedef typename std::map<int, T>
Static;
61 typedef typename std::map<int, T>::const_iterator
iterator;
73 const T *
search(
int index)
const;
74 const T *
find(
int index)
const;
80 typedef typename std::vector<T *>::const_iterator
Iter;
124 return !(*
this == x);
162 const T *
search(
const std::string &
id)
const;
167 bool isDynamic(
const std::string &
id)
const;
172 const T *
find(
const std::string &
id)
const;
176 const T *
findRandom(
const std::string &
id)
const;
191 bool erase(
const std::string &
id);
192 bool erase(
const T &item);
209 typedef std::vector<ESM::LandTexture>::const_iterator
iterator;
217 void resize(
size_t num);
220 size_t getSize(
size_t plugin)
const;
257 bool operator()(
const std::pair<int, int> &left,
const std::pair<int, int> &right)
const {
258 if (left.first == right.first && left.second == right.second)
261 if (left.first == right.first)
262 return left.second > right.second;
267 return left.first > right.first;
291 const ESM::Cell *searchOrCreate(
int x,
int y);
306 const ESM::Cell *searchExtByName(
const std::string &
id)
const;
309 const ESM::Cell *searchExtByRegion(
const std::string &
id)
const;
318 bool erase(
const std::string &
id);
320 bool erase(
int x,
int y);
327 typedef std::map<std::string, ESM::Pathgrid>
Interior;
374 typedef std::vector<ESM::Attribute>::const_iterator
iterator;
bool erase(const std::string &id)
Definition: store.cpp:295
SharedIterator(const Iter &iter)
Definition: store.hpp:91
const T * find(const std::string &id) const
Definition: store.cpp:165
const T * search(int index) const
Definition: store.cpp:87
SharedIterator & operator++()
Definition: store.hpp:95
Store()
Definition: store.cpp:111
virtual bool eraseStatic(const std::string &id)
Definition: store.hpp:44
const T & operator*() const
Definition: store.hpp:127
virtual void listIdentifier(std::vector< std::string > &list) const
List identifiers of records contained in this Store (case-smashed). No-op for Stores that don't use s...
Definition: store.hpp:38
Definition: esmreader.hpp:21
RecordId(const std::string &id="", bool isDeleted=false)
Definition: store.cpp:46
std::vector< ESM::Attribute >::const_iterator iterator
Definition: store.hpp:374
void num(char i, bool last)
Definition: gen_iconv.cpp:12
virtual size_t getSize() const =0
std::map< std::string, ESM::Pathgrid > Interior
Definition: store.hpp:327
std::map< std::string, T > mDynamic
Definition: store.hpp:145
virtual void clearDynamic()
Definition: store.cpp:122
bool operator!=(const SharedIterator &x) const
Definition: store.hpp:123
RecordId load(ESM::ESMReader &esm)
Definition: store.cpp:188
iterator end() const
Definition: store.cpp:60
Definition: store.hpp:139
bool operator()(const std::pair< int, int > &left, const std::pair< int, int > &right) const
Definition: store.hpp:257
Definition: store.hpp:253
std::vector< T * > mShared
Definition: store.hpp:142
const T * search(const std::string &id) const
Definition: store.cpp:131
Definition: loadltex.hpp:28
std::map< int, T >::const_iterator iterator
Definition: store.hpp:61
Definition: loadland.hpp:20
void load(ESM::ESMReader &esm)
Definition: store.cpp:65
std::vector< ESM::Cell * > mSharedExt
Definition: store.hpp:278
Definition: loadinglistener.hpp:8
std::map< std::string, T > mStatic
Definition: store.hpp:141
virtual void clearDynamic()
Definition: store.hpp:45
int getSize() const
Definition: store.cpp:78
DynamicInt mInt
Definition: store.hpp:274
Interior mInt
Definition: store.hpp:330
Definition: esmwriter.hpp:17
RecordId read(ESM::ESMReader &reader)
Read into dynamic storage.
Definition: store.cpp:329
std::map< std::pair< int, int >, ESM::Pathgrid > Exterior
Definition: store.hpp:328
SharedIterator & operator--()
Definition: store.hpp:107
void listIdentifier(std::vector< std::string > &list) const
Definition: store.cpp:232
T * insertStatic(const T &item)
Definition: store.cpp:255
Definition: esmstore.hpp:17
std::string mId
Definition: store.hpp:24
void setUp()
Definition: store.cpp:205
SharedIterator operator++(int)
Definition: store.hpp:100
iterator begin() const
Definition: store.cpp:210
std::map< std::string, ESM::Cell > DynamicInt
Definition: store.hpp:271
iterator end() const
Definition: store.cpp:215
void setUp()
Definition: store.cpp:83
bool eraseStatic(const std::string &id)
Definition: store.cpp:269
bool mIsDeleted
Definition: store.hpp:25
DynamicExt mExt
Definition: store.hpp:275
void write(ESM::ESMWriter &writer, Loading::Listener &progress) const
Definition: store.cpp:318
virtual void setUp()
Definition: store.hpp:35
std::map< std::pair< int, int >, ESM::Cell, DynamicExtCmp > DynamicExt
Definition: store.hpp:272
bool isDynamic(const std::string &id) const
Definition: store.cpp:150
std::vector< ESM::Cell * > mSharedInt
Definition: store.hpp:277
Definition: loadpgrd.hpp:16
Store< ESM::Cell > * mCells
Definition: store.hpp:333
Definition: loadcell.hpp:64
size_t getSize() const
Definition: store.cpp:221
SharedIterator operator--(int)
Definition: store.hpp:112
virtual ~StoreBase()
Definition: store.hpp:33
SharedIterator()
Definition: store.hpp:85
std::vector< ESM::Land * > mStatic
Definition: store.hpp:232
const T * find(int index) const
Definition: store.cpp:95
virtual RecordId read(ESM::ESMReader &reader)
Read into dynamic storage.
Definition: store.hpp:49
DynamicExt mDynamicExt
Definition: store.hpp:281
DynamicInt mDynamicInt
Definition: store.hpp:280
std::vector< LandTextureList > mStatic
Definition: store.hpp:204
SharedIterator< ESM::Land > iterator
Definition: store.hpp:235
iterator begin() const
Definition: store.cpp:55
virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress) const
Definition: store.hpp:47
std::map< std::string, T > Static
Definition: store.hpp:148
IndexedStore()
Definition: store.cpp:51
bool operator==(const SharedIterator &x) const
Definition: store.hpp:119
T * insert(const T &item)
Definition: store.cpp:241
const T * searchRandom(const std::string &id) const
Definition: store.cpp:156
Exterior mExt
Definition: store.hpp:331
const T * operator->() const
Definition: store.hpp:131
virtual RecordId load(ESM::ESMReader &esm)=0
std::vector< ESM::LandTexture >::const_iterator iterator
Definition: store.hpp:209
virtual int getDynamicSize() const
Definition: store.hpp:41
Iter mIter
Definition: store.hpp:82
int getDynamicSize() const
Definition: store.cpp:227
std::vector< ESM::Attribute > mStatic
Definition: store.hpp:371
Static mStatic
Definition: store.hpp:58
std::map< int, T > Static
Definition: store.hpp:57
SharedIterator< ESM::Cell > iterator
Definition: store.hpp:287
SharedIterator(const SharedIterator &orig)
Definition: store.hpp:87
std::map< std::string, T > Dynamic
Definition: store.hpp:147
std::vector< ESM::LandTexture > LandTextureList
Definition: store.hpp:203
const T * findRandom(const std::string &id) const
Definition: store.cpp:176
std::vector< T * >::const_iterator Iter
Definition: store.hpp:80
const char * name
Definition: crashcatcher.cpp:59
SharedIterator< T > iterator
Definition: store.hpp:156