22 #include "containers.h" 24 BEGIN_NAMESPACE_CONTAINERS
32 enum class ConstTypeSwitch
38 template <
typename T, ConstTypeSwitch ConstSwitch>
42 using PointeeType =
typename std::vector<std::pair<int32_t, T>>::iterator;
48 using ValueType =
const T;
49 using PointeeType =
typename std::vector<std::pair<int32_t,T>>::const_iterator;
56 using PointeeType =
typename std::vector<std::pair<int32_t, T>>::iterator;
59 template <
typename T, ConstTypeSwitch ConstSwitch>
65 using ValueType =
typename UnderlyingTypes<T, ConstSwitch>::ValueType;
66 using PointeeType =
typename UnderlyingTypes<T, ConstSwitch>::PointeeType;
68 using iterator_category = std::forward_iterator_tag;
69 using value_type = ValueType;
70 using difference_type = std::ptrdiff_t;
71 using pointer = ValueType*;
72 using reference = ValueType&;
79 int32_t
getId()
const;
132 template <
typename T, ConstTypeSwitch ConstSwitch>
135 return pointee->first;
138 template <
typename T, ConstTypeSwitch ConstSwitch>
141 return pointee->second;
144 template <
typename T, ConstTypeSwitch ConstSwitch>
147 return &(pointee->second);
150 template <
typename T, ConstTypeSwitch ConstSwitch>
157 template <
typename T, ConstTypeSwitch ConstSwitch>
162 return previousState;
165 template <
typename T, ConstTypeSwitch ConstSwitch>
171 template <
typename T, ConstTypeSwitch ConstSwitch>
174 return pointee == other.pointee;
177 template <
typename T, ConstTypeSwitch ConstSwitch>
180 return pointee != other.pointee;
185 END_NAMESPACE_CONTAINERS
Definition: vector_with_ids.h:38
int32_t getId() const
Definition: vector_with_ids_iterator.h:133
Definition: vector_with_ids_iterator.h:60
const VectorWithIdsIterator< T, ConstSwitch > & operator++()
Post increment iterator to the next element in container.
Definition: vector_with_ids_iterator.h:151
ValueType * operator->()
Definition: vector_with_ids_iterator.h:145
bool operator!=(const VectorWithIdsIterator< T, ConstSwitch > &other) const
Check if iterators don't point to the same element in the container.
Definition: vector_with_ids_iterator.h:178
Definition: vector_with_ids_iterator.h:30
Definition: vector_with_ids_iterator.h:39
bool operator==(const VectorWithIdsIterator< T, ConstSwitch > &other) const
Check if iterators point to the same element in the container.
Definition: vector_with_ids_iterator.h:172
ValueType & operator*()
Definition: vector_with_ids_iterator.h:139
VectorWithIdsIterator< T, ConstSwitch > operator+(int32_t increment)
Increment iterator to by the number of elements passed as an increment.
Definition: vector_with_ids_iterator.h:166