Doomsday SDK  2.3
Core engine library and supporting libraries
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
de::PointerSet Class Reference

Set of pointers. More...

#include <pointerset.h>

+ Inheritance diagram for de::PointerSet:

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
 
IIterationObserveriterationObserver () const
 
PointerSetoperator= (PointerSet const &other)
 
PointerSetoperator= (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
 

Detailed Description

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.

Member Typedef Documentation

◆ const_iterator

Definition at line 40 of file pointerset.h.

◆ Flag

Definition at line 41 of file pointerset.h.

◆ Pointer

typedef void* de::PointerSet::Pointer

Definition at line 39 of file pointerset.h.

Constructor & Destructor Documentation

◆ PointerSet() [1/3]

de::PointerSet::PointerSet ( )

Definition at line 30 of file pointerset.cpp.

◆ PointerSet() [2/3]

de::PointerSet::PointerSet ( PointerSet const &  other)

Definition at line 37 of file pointerset.cpp.

◆ PointerSet() [3/3]

de::PointerSet::PointerSet ( PointerSet &&  moved)

Definition at line 48 of file pointerset.cpp.

◆ ~PointerSet()

de::PointerSet::~PointerSet ( )

Definition at line 58 of file pointerset.cpp.

Member Function Documentation

◆ allocatedSize()

int de::PointerSet::allocatedSize ( ) const
inline

Definition at line 74 of file pointerset.h.

◆ at()

Pointer de::PointerSet::at ( duint16  pos) const
inlineprotected

Definition at line 90 of file pointerset.h.

◆ begin()

const_iterator de::PointerSet::begin ( ) const
inline

Definition at line 75 of file pointerset.h.

◆ clear()

void de::PointerSet::clear ( )

Definition at line 204 of file pointerset.cpp.

◆ contains()

bool de::PointerSet::contains ( Pointer  ptr) const

Definition at line 199 of file pointerset.cpp.

◆ end()

const_iterator de::PointerSet::end ( ) const
inline

Definition at line 76 of file pointerset.h.

◆ flags()

Flag de::PointerSet::flags ( ) const
inline

Definition at line 70 of file pointerset.h.

◆ insert()

void de::PointerSet::insert ( Pointer  ptr)

Definition at line 68 of file pointerset.cpp.

◆ isBeingIterated()

bool de::PointerSet::isBeingIterated ( ) const

Definition at line 260 of file pointerset.cpp.

◆ isEmpty()

bool de::PointerSet::isEmpty ( ) const
inline

Definition at line 72 of file pointerset.h.

◆ iterationObserver()

IIterationObserver* de::PointerSet::iterationObserver ( ) const
inline

Definition at line 85 of file pointerset.h.

◆ locate()

Rangeui16 de::PointerSet::locate ( Pointer  ptr) const
protected

Definition at line 270 of file pointerset.cpp.

◆ operator=() [1/2]

PointerSet & de::PointerSet::operator= ( PointerSet const &  other)

Definition at line 213 of file pointerset.cpp.

◆ operator=() [2/2]

PointerSet & de::PointerSet::operator= ( PointerSet &&  moved)

Definition at line 229 of file pointerset.cpp.

◆ remove()

void de::PointerSet::remove ( Pointer  ptr)

Definition at line 169 of file pointerset.cpp.

◆ setBeingIterated()

void de::PointerSet::setBeingIterated ( bool  yes) const

Definition at line 243 of file pointerset.cpp.

◆ setFlags()

void de::PointerSet::setFlags ( Flag  flags,
FlagOpArg  op = SetFlags 
)
inline

Definition at line 78 of file pointerset.h.

◆ setIterationObserver()

void de::PointerSet::setIterationObserver ( IIterationObserver observer) const

Definition at line 265 of file pointerset.cpp.

◆ size()

int de::PointerSet::size ( ) const
inline

Definition at line 71 of file pointerset.h.

◆ usedRange()

Rangeui16 de::PointerSet::usedRange ( ) const
inline

Definition at line 73 of file pointerset.h.

Member Data Documentation

◆ AllowInsertionDuringIteration

PointerSet::Flag const de::PointerSet::AllowInsertionDuringIteration = 0x8000
static

Definition at line 43 of file pointerset.h.


The documentation for this class was generated from the following files: