|
| | JSet (Compare comp=Compare{}, ALLOC alloc=ALLOC{}) |
| | Constructs empty JSet.
|
| |
| | JSet (const JSet &other) |
| | Copy constructor.
|
| |
| JSet & | operator= (const JSet &other) |
| | Copy assignment operator.
|
| |
| | JSet (JSet &&other) noexcept |
| | Move constructor.
|
| |
| JSet & | operator= (JSet &&other) noexcept |
| | Move assignment operator.
|
| |
| u_integer | size () const override |
| | Gets number of elements.
|
| |
| bool | contains (const TYPE &e) const override |
| | Checks if element exists.
|
| |
| bool | add (const TYPE &e) override |
| | Adds new element.
|
| |
| bool | remove (const TYPE &e) override |
| | Removes element.
|
| |
| Iterator * | begins () const override |
| | Gets begin iterator.
|
| |
| Iterator * | ends () const override |
| | Gets end iterator.
|
| |
| std::string | className () const override |
| | Gets class name.
|
| |
| std::string | toString (bool enter) const override |
| | Converts to string representation.
|
| |
| | ~JSet () override |
| | Destructor.
|
| |
| iterAdaptor | begin () |
| | Returns an iterator adapter pointing to the beginning of the container.
|
| |
| iterAdaptor | begin () const |
| | Returns a const iterator adapter pointing to the beginning of the container.
|
| |
| iterAdaptor | end () |
| | Returns an iterator adapter pointing to the end sentinel of the container.
|
| |
| iterAdaptor | end () const |
| | Returns a const iterator adapter pointing to the end sentinel of the container.
|
| |
| iterAdaptor | first () |
| | Returns an iterator adapter pointing to the first element.
|
| |
| iterAdaptor | first () const |
| | Returns a const iterator adapter pointing to the first element.
|
| |
| iterAdaptor | last () |
| | Returns an iterator adapter pointing to the last element.
|
| |
| iterAdaptor | last () const |
| | Returns a const iterator adapter pointing to the last element.
|
| |
| void | forEach (Callback operation=Callback{}) |
| | Applies a given operation to each element in the iterable container.
|
| |
| void | forEach (const Callback &operation=Callback{}) const |
| | Applies a given operation to each element in the iterable container (const version).
|
| |
|
auto | forEach (Callback operation) -> void |
| |
|
auto | forEach (const Callback &operation) const -> void |
| |
| | operator std::string () const |
| | Explicit conversion to std::string.
|
| |
| | operator const char * () const |
| | Explicit conversion to C-style string.
|
| |
| const char * | toCString (bool enter) const |
| | Direct C-string access with formatting control.
|
| |
|
template<typename TYPE > |
| auto | formatString (const TYPE &t) -> std::string |
| |
|
template<typename TYPE > |
| auto | formatCString (const TYPE &t) -> const char * |
| |
|
template<typename TYPE > |
| auto | formatEnum (const TYPE &t) -> std::string |
| |
|
template<typename TYPE > |
| auto | formatString (TYPE *const &ptr) -> std::string |
| |
|
| template<typename TYPE > |
| static std::string | formatString (const TYPE &t) |
| | Universal value-to-string conversion.
|
| |
| template<Printable TYPE> |
| static std::string | formatString (const TYPE &t) |
| | Specialization for printable types.
|
| |
| template<EnumType TYPE> |
| static std::string | formatString (const TYPE &t) |
| | Specialization for enum types.
|
| |
| template<typename TYPE > |
| static std::string | formatString (TYPE *const &ptr) |
| | Pointer-specific formatting.
|
| |
| template<typename TYPE > |
| static const char * | formatCString (const TYPE &t) |
| | C-string cache for temporary usage.
|
| |
| template<typename TYPE > |
| static std::string | formatEnum (const TYPE &t) |
| | Enum formatting utility.
|
| |
|
template<> |
| auto | formatString (const char &t) -> std::string |
| |
|
template<> |
| auto | formatString (const bool &t) -> std::string |
| |
|
template<> |
| auto | formatString (const char *const &ptr) -> std::string |
| |
template<typename TYPE, typename Compare = increaseComparator<TYPE>, typename ALLOC = allocator<couple<const TYPE, const bool>>>
class original::JSet< TYPE, Compare, ALLOC >
Skip List based implementation of the set interface.
- Template Parameters
-
| TYPE | Element type (must be comparable) |
| Compare | Comparison function type (default: increaseComparator<TYPE>) |
| ALLOC | Allocator type (default: allocator<couple<const TYPE, const bool>>) |
This class provides a concrete implementation of the set interface using a probabilistic skip list. It combines the functionality of:
- set (interface)
- skipList (storage with bool values)
- iterable (iteration support)
Performance Characteristics:
- Insertion: Average O(log n), Worst O(n)
- Lookup: Average O(log n), Worst O(n)
- Deletion: Average O(log n), Worst O(n)
The implementation guarantees:
- Elements sorted according to comparator
- Unique elements (no duplicates)
- Type safety
- Exception safety (basic guarantee)
- Iterator validity unless modified