ReactPhysics3D
v0.10.2
C++ Physics engine library
|
This class represents a simple generic set. More...
#include <include/reactphysics3d/containers/Set.h>
Classes | |
class | Iterator |
Class Iterator. More... | |
Public Member Functions | |
Set (MemoryAllocator &allocator, uint64 capacity=0) | |
Constructor. | |
Set (const Set< V, Hash, KeyEqual > &set) | |
Copy constructor. | |
~Set () | |
Destructor. | |
void | reserve (uint64 capacity) |
Allocate memory for a given number of elements. | |
bool | contains (const V &value) const |
Return true if the set contains a given value. | |
bool | add (const V &value) |
Add a value into the set. | |
Iterator | remove (const Iterator &it) |
Remove the element pointed by some iterator This method returns an iterator pointing to the element after the one that has been removed. | |
Iterator | remove (const V &value) |
Remove the element from the set with a given value This method returns an iterator pointing to the element after the one that has been removed. | |
Array< V > | toArray (MemoryAllocator &arrayAllocator) const |
Return an array with all the values of the set. | |
void | clear (bool releaseMemory=false) |
Clear the set. | |
uint64 | size () const |
Return the number of elements in the set. | |
uint64 | capacity () const |
Return the capacity of the set. | |
Iterator | find (const V &value) const |
Try to find an item of the set given a key. | |
bool | operator== (const Set< V > &set) const |
Overloaded equality operator. | |
bool | operator!= (const Set< V > &set) const |
Overloaded not equal operator. | |
Set< V > & | operator= (const Set< V > &set) |
Overloaded assignment operator. | |
Iterator | begin () const |
Return a begin iterator. | |
Iterator | end () const |
Return a end iterator. | |
This class represents a simple generic set.
This set is implemented with a hash table.
|
inline |
Add a value into the set.
Returns true if the item has been inserted and false otherwise.
|
inline |
Try to find an item of the set given a key.
The method returns an iterator to the found item or an iterator pointing to the end if not found