15 return mIndexFace.size();
20#if MYGUI_DEBUG_MODE == 1
26 _index = mIndexFace.size();
30 if (_index == mIndexFace.size())
33 index = mIndexFace.size();
35 mIndexFace.push_back(_index);
36 mIndexBack.push_back(_index);
41 index = mIndexFace[_index];
43 size_t count = mIndexFace.size();
44 for (
size_t pos = 0; pos < count; ++pos)
46 if (mIndexFace[pos] >= index)
49 mIndexFace.insert(mIndexFace.begin() + _index, index);
52 mIndexBack.push_back(0);
53 for (
size_t pos = 0; pos < count; ++pos)
55 mIndexBack[mIndexFace[pos]] = pos;
59#if MYGUI_DEBUG_MODE == 1
68#if MYGUI_DEBUG_MODE == 1
74 size_t index = mIndexFace[_index];
76 mIndexFace.erase(mIndexFace.begin() + _index);
77 mIndexBack.pop_back();
79 size_t count = mIndexFace.size();
80 for (
size_t pos = 0; pos < count; ++pos)
82 if (mIndexFace[pos] > index)
84 mIndexBack[mIndexFace[pos]] = pos;
87#if MYGUI_DEBUG_MODE == 1
103#if MYGUI_DEBUG_MODE == 1
112#if MYGUI_DEBUG_MODE == 1
121#if MYGUI_DEBUG_MODE == 1
126 std::swap(mIndexFace[_index1], mIndexFace[_index2]);
127 std::swap(mIndexBack[mIndexFace[_index1]], mIndexBack[mIndexFace[_index2]]);
133#if MYGUI_DEBUG_MODE == 1
138 std::swap(mIndexBack[_index1], mIndexBack[_index2]);
139 std::swap(mIndexFace[mIndexBack[_index1]], mIndexFace[mIndexBack[_index2]]);
142#if MYGUI_DEBUG_MODE == 1
144 void BiIndexBase::checkIndexes()
146 assert(mIndexFace.size() == mIndexBack.size());
149 std::vector<bool> vec;
150 size_t count = mIndexFace.size();
153 for (
size_t pos = 0; pos < count; ++pos)
154 vec.push_back(
false);
156 for (
size_t pos = 0; pos < count; ++pos)
159 size_t index = mIndexBack[pos];
161 throw new std::exception();
164 index = mIndexFace[pos];
166 throw new std::exception();
169 throw new std::exception();
173 for (
size_t pos = 0; pos < count; ++pos)
176 throw new std::exception();
180 for (
size_t pos = 0; pos < count; ++pos)
182 size_t index = mIndexFace[pos];
183 if (mIndexBack[index] != pos)
184 throw new std::exception();
#define MYGUI_ASSERT_RANGE_INSERT(index, size, owner)
#define MYGUI_ASSERT_RANGE(index, size, owner)
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
void swapItemsBackAt(size_t _index1, size_t _index2)
size_t removeItemAt(size_t _index)
size_t insertItemAt(size_t _index)
size_t convertToBack(size_t _index) const
size_t convertToFace(size_t _index) const
size_t getIndexCount() const
void swapItemsFaceAt(size_t _index1, size_t _index2)