![]() |
Doomsday SDK
2.3
Core engine library and supporting libraries
|
Set of pointers. More...
#include <pointerset.h>
Classes | |
class | AdditionForbiddenError |
Addition was not possible because the set is being iterated. More... | |
class | IIterationObserver |
Public Types | |
typedef Pointer const * | const_iterator |
typedef duint16 | Flag |
typedef void * | Pointer |
Public Member Functions | |
PointerSet () | |
PointerSet (PointerSet const &other) | |
PointerSet (PointerSet &&moved) | |
~PointerSet () | |
int | allocatedSize () const |
const_iterator | begin () const |
void | clear () |
bool | contains (Pointer ptr) const |
const_iterator | end () const |
Flag | flags () const |
void | insert (Pointer ptr) |
bool | isBeingIterated () const |
bool | isEmpty () const |
IIterationObserver * | iterationObserver () const |
PointerSet & | operator= (PointerSet const &other) |
PointerSet & | operator= (PointerSet &&moved) |
void | remove (Pointer ptr) |
void | setBeingIterated (bool yes) const |
void | setFlags (Flag flags, FlagOpArg op=SetFlags) |
void | setIterationObserver (IIterationObserver *observer) const |
int | size () const |
Rangeui16 | usedRange () const |
Static Public Attributes | |
static Flag const | AllowInsertionDuringIteration = 0x8000 |
Protected Member Functions | |
Pointer | at (duint16 pos) const |
Rangeui16 | locate (Pointer ptr) const |
Set of pointers.
Light-weight class specifically designed to be used for observer audiences. Maintains a sorted vector of pointers. Insertions, deletions, and lookups are done with an O(log n) binary search. Insertions start at the middle to allow expansion to both directions. Removing individual pointers is allowed at any time.
Definition at line 36 of file pointerset.h.
typedef Pointer const* de::PointerSet::const_iterator |
Definition at line 40 of file pointerset.h.
typedef duint16 de::PointerSet::Flag |
Definition at line 41 of file pointerset.h.
typedef void* de::PointerSet::Pointer |
Definition at line 39 of file pointerset.h.
de::PointerSet::PointerSet | ( | ) |
Definition at line 30 of file pointerset.cpp.
de::PointerSet::PointerSet | ( | PointerSet const & | other | ) |
Definition at line 37 of file pointerset.cpp.
de::PointerSet::PointerSet | ( | PointerSet && | moved | ) |
Definition at line 48 of file pointerset.cpp.
de::PointerSet::~PointerSet | ( | ) |
Definition at line 58 of file pointerset.cpp.
|
inline |
Definition at line 74 of file pointerset.h.
Definition at line 90 of file pointerset.h.
|
inline |
Definition at line 75 of file pointerset.h.
void de::PointerSet::clear | ( | ) |
Definition at line 204 of file pointerset.cpp.
bool de::PointerSet::contains | ( | Pointer | ptr | ) | const |
Definition at line 199 of file pointerset.cpp.
|
inline |
Definition at line 76 of file pointerset.h.
|
inline |
Definition at line 70 of file pointerset.h.
void de::PointerSet::insert | ( | Pointer | ptr | ) |
Definition at line 68 of file pointerset.cpp.
bool de::PointerSet::isBeingIterated | ( | ) | const |
Definition at line 260 of file pointerset.cpp.
|
inline |
Definition at line 72 of file pointerset.h.
|
inline |
Definition at line 85 of file pointerset.h.
Definition at line 270 of file pointerset.cpp.
PointerSet & de::PointerSet::operator= | ( | PointerSet const & | other | ) |
Definition at line 213 of file pointerset.cpp.
PointerSet & de::PointerSet::operator= | ( | PointerSet && | moved | ) |
Definition at line 229 of file pointerset.cpp.
void de::PointerSet::remove | ( | Pointer | ptr | ) |
Definition at line 169 of file pointerset.cpp.
void de::PointerSet::setBeingIterated | ( | bool | yes | ) | const |
Definition at line 243 of file pointerset.cpp.
Definition at line 78 of file pointerset.h.
void de::PointerSet::setIterationObserver | ( | IIterationObserver * | observer | ) | const |
Definition at line 265 of file pointerset.cpp.
|
inline |
Definition at line 71 of file pointerset.h.
|
inline |
Definition at line 73 of file pointerset.h.
|
static |
Definition at line 43 of file pointerset.h.