Support Forum G3D Web Page |
An unordered data structure that has at most one of each element. More...
Classes | |
class | Iterator |
C++ STL style iterator variable. More... | |
Public Member Functions | |
virtual | ~Set () |
Iterator | begin () const |
C++ STL style iterator method. More... | |
void | clear () |
void | clearAndSetMemoryManager (const shared_ptr< MemoryManager > &m) |
bool | contains (const T &member) const |
void | deleteAll () |
const Iterator | end () const |
C++ STL style iterator method. More... | |
Array< T > | getMembers () const |
void | getMembers (Array< T > &keyArray) const |
const T * | getPointer (const T &member) const |
If a value that is EqualsFunc to member is present, returns a pointer to the version stored in the data structure, otherwise returns nullptr. More... | |
bool | getRemove (const T &member, T &removed) |
If member is present, sets removed to the element being removed and returns true. More... | |
bool | insert (const T &member) |
Inserts into the table if not already present. More... | |
bool | remove (const T &member) |
Returns true if the element was present and removed. More... | |
int | size () const |
An unordered data structure that has at most one of each element.
Provides O(1) time insert, remove, and member test (contains).
Set uses G3D::Table internally, which means that the template type T must define a hashCode and operator== function. See G3D::Table for a discussion of these functions.
|
inlinevirtual |
|
inline |
C++ STL style iterator method.
Returns the first member.
Use preincrement (++entry) to get to the next element.
Do not modify the set while iterating.
|
inline |
Referenced by G3D::Set< size_t >::deleteAll().
|
inline |
|
inline |
|
inline |
|
inline |
C++ STL style iterator method.
Returns one after the last iterator element.
|
inline |
Referenced by G3D::Set< size_t >::deleteAll().
|
inline |
|
inline |
If a value that is EqualsFunc to member is present, returns a pointer to the version stored in the data structure, otherwise returns nullptr.
|
inline |
If member is present, sets removed to the element being removed and returns true.
Otherwise returns false and does not write to removed. This is useful when building efficient hashed data structures that wrap Set.
|
inline |
Inserts into the table if not already present.
Returns true if this is the first time the element was added.
Referenced by G3D::BlockPoolMemoryManager::alloc(), G3D::AnyTableReader::get(), G3D::AnyTableReader::operator[](), and G3D::AnyTableReader::setReadStatus().
|
inline |
Returns true if the element was present and removed.
Returns false if the element was not present.
Referenced by G3D::AnyTableReader::setReadStatus().
|
inline |
Referenced by G3D::AnyTableReader::hasMore(), and G3D::BlockPoolMemoryManager::peakNumBlocks().