The FixedSet class provides a set implementation which allows for insertion, querying, and deletion in constant time. While std::unordered_set may give constant time complexity of these operations through a hash table, this does so through fixed size dense vector (no hashing).
More...
#include <FixedSet.hpp>
|
| | FixedSet (size_t const size) |
| | Create a new empty fixed set. More...
|
| |
| bool | has (T const element) const noexcept |
| | Check if an element exists in this set. More...
|
| |
| void | add (T const element) noexcept |
| | Add an element to this set. More...
|
| |
| void | remove (T const element) noexcept |
| | Remove an element from this set. More...
|
| |
| T * | data () noexcept |
| | Get the underlying array. More...
|
| |
| T const * | data () const noexcept |
| | Get the underlying array. More...
|
| |
| size_t | size () const noexcept |
| | Get the number of elements in the set. More...
|
| |
| T const * | begin () const noexcept |
| | Get the beginning iterator. More...
|
| |
| T const * | end () const noexcept |
| | Get the end iterator. More...
|
| |
| T * | begin () noexcept |
| | Get the beginning iterator (mutable). More...
|
| |
| T * | end () noexcept |
| | Get the end iterator (mutable). More...
|
| |
|
|
static constexpr T const | NULL_INDEX = static_cast<T>(-1) |
| |
template<typename T>
class sl::FixedSet< T >
The FixedSet class provides a set implementation which allows for insertion, querying, and deletion in constant time. While std::unordered_set may give constant time complexity of these operations through a hash table, this does so through fixed size dense vector (no hashing).
- Template Parameters
-
| T | The type of element to store. |
◆ FixedSet()
Create a new empty fixed set.
- Parameters
-
◆ add()
Add an element to this set.
- Parameters
-
| element | The element to add. |
◆ begin() [1/2]
Get the beginning iterator.
- Returns
- The iterator/pointer.
◆ begin() [2/2]
Get the beginning iterator (mutable).
- Returns
- The iterator/pointer.
◆ data() [1/2]
Get the underlying array.
- Returns
- The data.
◆ data() [2/2]
Get the underlying array.
- Returns
- The data.
◆ end() [1/2]
Get the end iterator.
- Returns
- The iterator/pointer.
◆ end() [2/2]
Get the end iterator (mutable).
- Returns
- The iterator/pointer.
◆ has()
Check if an element exists in this set.
- Parameters
-
- Returns
- True if the element is in the set.
◆ remove()
Remove an element from this set.
- Parameters
-
| element | The element to remove. |
◆ size()
Get the number of elements in the set.
- Returns
- The number of elements.
The documentation for this class was generated from the following file: