OSVR-Core
|
A policy-based generic "Unique Container", that wraps ContainerWrapper (and thus an underlying container) with set-like semantics/invariant: at most one instance of a value is in the container at a time. More...
#include <UniqueContainer.h>
Protected Member Functions | |
bool | contains (const_reference v) |
Returns true iff the underlying container contains an instance of the given value. More... | |
bool | insert (const_reference v) |
bool | insert (rv_reference v) |
bool | remove (const_reference v) |
Container const & | container () const |
Const access to the container is permitted. | |
A policy-based generic "Unique Container", that wraps ContainerWrapper (and thus an underlying container) with set-like semantics/invariant: at most one instance of a value is in the container at a time.
Intended as a base class, provides all its functionality in protected members.
Container | underlying container (such as std::vector<value_type>) |
Policy | a type from osvr::util::unique_container_policies, defaulting to osvr::util::unique_container_policies::PushBack, that affects container interaction and performance, and may add additional invariants (such as ordering). |
WrapperArgs | optional arguments to forward to osvr::util::ContainerWrapper |
Blocks direct non-const access to the underlying container to maintain the class invariants.
For all methods, time complexity depends on the policy selected.
|
inlineprotected |
Returns true iff the underlying container contains an instance of the given value.