OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::util::UniqueContainerBase< Container, Policy, WrapperArgs > Class Template Reference

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 <osvr/Util/UniqueContainer.h>

Inherits ContainerWrapper< Container, WrapperArgs...>.

Protected Member Functions

bool contains (const_reference v)
 Returns true iff the underlying container contains an instance of the given value.
 
Container const & container () const
 Const access to the container is permitted.
 

Detailed Description

template<typename Container, typename Policy = unique_container_policies::PushBack, typename... WrapperArgs>
class osvr::util::UniqueContainerBase< Container, Policy, WrapperArgs >

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.

Template Parameters
Containerunderlying container (such as std::vector<value_type>)
Policya 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).
WrapperArgsoptional 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.

See also
osvr::util::unique_container_policies, osvr::util::ContainerWrapper, osvr::util::container_policies

Definition at line 289 of file UniqueContainer.h.


The documentation for this class was generated from the following file: