26 #ifndef INCLUDED_ContainerWrapper_h_GUID_87C9C3C2_1A4E_4BA8_A160_96145B60CEDB 27 #define INCLUDED_ContainerWrapper_h_GUID_87C9C3C2_1A4E_4BA8_A160_96145B60CEDB 49 namespace container_policies {
57 struct const_iterators;
66 struct const_subscript;
76 typedef typename Container::value_type value_type;
77 typedef typename Container::reference reference;
78 typedef typename Container::const_reference const_reference;
79 typedef typename Container::size_type size_type;
80 typedef typename Container::iterator iterator;
81 typedef typename Container::const_iterator const_iterator;
84 Container &container() {
return m_container; }
85 Container
const &container()
const {
return m_container; }
86 Container
const &ccontainer()
const {
return m_container; }
89 Container m_container;
94 template <
typename Container,
typename Base>
97 typedef typename Container::const_iterator const_iterator;
98 const_iterator begin()
const {
return Base::container().begin(); }
99 const_iterator cbegin()
const {
return Base::container().cbegin(); }
100 const_iterator end()
const {
return Base::container().end(); }
101 const_iterator cend()
const {
return Base::container().cend(); }
106 template <
typename Container,
typename Base>
110 typedef typename Container::iterator iterator;
111 iterator begin() {
return Base::container().begin(); }
112 iterator end() {
return Base::container().end(); }
116 template <
typename Container,
typename Base>
119 typedef typename Container::size_type size_type;
120 size_type
size()
const {
return Base::container().size(); }
124 template <
typename Container,
typename Base>
127 bool empty()
const {
return Base::container().empty(); }
132 template <
typename Container,
typename Base>
135 typedef typename Container::size_type size_type;
136 typedef typename Container::const_reference const_reference;
137 const_reference operator[](size_type index)
const {
138 return Base::container()[index];
144 template <
typename Container,
typename Base>
147 typedef typename Container::size_type size_type;
148 typedef typename Container::reference reference;
149 typedef typename Container::const_reference const_reference;
150 reference operator[](size_type index) {
151 return Base::container()[index];
153 const_reference operator[](size_type index)
const {
154 return Base::container()[index];
160 template <
typename Condition,
161 template <
class,
class>
class ContainerMixin>
163 using condition = Condition;
164 template <
typename Container,
typename Base>
165 using apply = ContainerMixin<Container, Base>;
170 template <
typename Base,
typename Option>
struct apply {
171 using condition =
typename Option::condition;
181 template <
typename Container,
typename ArgList>
184 using wants_iterators =
189 container_policies::const_iterators>>;
192 using wants_subscript =
197 container_policies::const_subscript>>;
220 template <
typename Container,
typename... Args>
231 template <
typename Container,
typename... Args>
237 #endif // INCLUDED_ContainerWrapper_h_GUID_87C9C3C2_1A4E_4BA8_A160_96145B60CEDB Definition: gtest_unittest.cc:5031
Alias class to use in fold when computing a container wrapper.
Definition: ContainerWrapper.h:169
Definition: RunLoopManager.h:42
Container wrapper mixin for consumers that want size.
Definition: ContainerWrapper.h:125
apply_list< quote< or_ >, transform< Haystack, detail::is_< Needle >>> contains
Determines if type Needle is in the list Haystack - is an alias for a type that inherits std::true_ty...
Definition: Contains.h:49
Container wrapper for consumers that want const iterator methods.
Definition: ContainerWrapper.h:95
Container wrapper mixin for consumers that want the array subscript operator, including also const-ar...
Definition: ContainerWrapper.h:145
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
t_< detail::and_impl< Bools... >> and_
Logically and together all the integral constant-wrapped Boolean parameters, with short-circuiting...
Definition: And.h:61
Holds the result of evaluating a condition along with the mixin template to use (as an alias class) i...
Definition: ContainerWrapper.h:162
A wrapper for a template parameter pack of types.
Definition: List.h:52
typename F::template apply< Args... > apply
Apply an alias class.
Definition: Apply.h:44
Terminal base class for container wrapper functionality.
Definition: ContainerWrapper.h:74
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
bool_<!Bool::value > not_
Logical not on a single boolean.
Definition: Not.h:43
Definition: newuoa.h:1888
t_< detail::if_impl< Args... >> if_
Select one type or another depending on a compile-time Boolean integral constant type.
Definition: If.h:61
Container wrapper mixin for consumers that want const array subscript operator methods.
Definition: ContainerWrapper.h:133
Container wrapper mixin for consumers that want size.
Definition: ContainerWrapper.h:117
Definition: ContainerWrapper.h:170
Main metafunction used to compute the full type of a container wrapper.
Definition: ContainerWrapper.h:182
Container wrapper for consumers that want iterator methods, including also const-iterator methods...
Definition: ContainerWrapper.h:107
typename T::type t_
A convenience alias template to extract the nested type within the supplied T.
Definition: T.h:52
detail::ContainerWrapper_t< Container, Args... > ContainerWrapper
Parent class to inherit from to get a container with some functionality exposed.
Definition: ContainerWrapper.h:232
t_< detail::fold_< List, State, Fun >> fold
Fold the list (right) with the given alias class and initial state.
Definition: Fold.h:57