mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 22:37:04 +00:00
Merge branch 'master' into 303
Conflicts: contrib/extractor/System.cpp contrib/extractor/ad.exe src/game/WorldSocket.cpp
This commit is contained in:
commit
78ec66babc
78 changed files with 510 additions and 752 deletions
|
|
@ -1538,80 +1538,6 @@ public:
|
|||
members.append(temp[i].handle->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
C++ STL style iterator variable. See begin().
|
||||
Overloads the -> (dereference) operator, so this acts like a pointer
|
||||
to the current member.
|
||||
*/
|
||||
class Iterator {
|
||||
private:
|
||||
friend class AABSPTree<T>;
|
||||
|
||||
Iterator(const typename Table<Member, Node*>::Iterator& it) : it(it) {}
|
||||
|
||||
public:
|
||||
|
||||
inline bool operator!=(const Iterator& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
bool operator==(const Iterator& other) const {
|
||||
return it == other.it;
|
||||
}
|
||||
|
||||
/**
|
||||
Pre increment.
|
||||
*/
|
||||
Iterator& operator++() {
|
||||
++it;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
Post increment (slower than preincrement). Intentionally unimplemented to prevent slow code.
|
||||
*/
|
||||
Iterator operator++(int);/* {
|
||||
Iterator old = *this;
|
||||
++(*this);
|
||||
return old;
|
||||
}*/
|
||||
public:
|
||||
|
||||
const T& operator*() const {
|
||||
return it->key.handle->value;
|
||||
}
|
||||
|
||||
T* operator->() const {
|
||||
return &(it->key.handle->value);
|
||||
}
|
||||
|
||||
operator T*() const {
|
||||
return &(it->key.handle->value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
C++ STL style iterator method. Returns the first member.
|
||||
Use preincrement (++entry) to get to the next element (iteration
|
||||
order is arbitrary).
|
||||
Do not modify the set while iterating.
|
||||
*/
|
||||
Iterator begin() const {
|
||||
return Iterator(memberTable.begin());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
C++ STL style iterator method. Returns one after the last iterator
|
||||
element.
|
||||
*/
|
||||
Iterator end() const {
|
||||
return Iterator(memberTable.end());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue