31 #include <boost/ptr_container/ptr_vector.hpp> 44 template<
typename T,
int FIRST_TYPE_VAL,
int LAST_TYPE_VAL>
54 "FIRST_TYPE_VAL has to be greater than UNDEFINED_TYPE" );
55 static_assert( FIRST_TYPE_VAL < LAST_TYPE_VAL,
56 "FIRST_TYPE_VAL has to be greater than LAST_TYPE_VAL" );
69 template<
typename ITEM_TYPE,
typename ITEM_CONTAINER,
typename ITEM_CONTAINER_IT>
167 typedef ITERATOR_BASE<const T, const MULTIVECTOR<T, FIRST_TYPE_VAL, LAST_TYPE_VAL>,
183 it.m_it = (*aIterator.m_parent)[ aIterator.m_curType ].erase( aIterator.m_it );
192 return ITERATOR(
this,
operator[]( bucket ).
begin(), bucket, aType );
198 return ITERATOR(
this,
operator[]( bucket ).
end(), bucket, aType );
245 return (
size( aType ) == 0 );
270 wxFAIL_MSG(
"Attempted access to type not within MULTIVECTOR" );
283 wxFAIL_MSG(
"Attempted access to type not within MULTIVECTOR" );
CONST_ITERATOR end(int aType=UNDEFINED_TYPE) const
CONST_ITERATOR begin(int aType=UNDEFINED_TYPE) const
const ITEM_PTR_VECTOR & operator[](int aType) const
ITERATOR begin(int aType=UNDEFINED_TYPE)
ITEM_PTR_VECTOR m_data[TYPES_COUNT]
Contained items by type
bool operator!=(const ITERATOR_BASE &aOther) const
ITERATOR_BASE(ITEM_CONTAINER *aItems, ITEM_CONTAINER_IT aIt, int aBucket, int aType=UNDEFINED_TYPE)
Constructor.
bool m_filter
Flag indicating whether type filtering is enabled
bool empty(int aType=UNDEFINED_TYPE)
static constexpr int TYPES_COUNT
void clear(int aType=UNDEFINED_TYPE)
void unique()
Remove duplicate elements in list.
Multivector container type.
static constexpr int LAST_TYPE
ITERATOR end(int aType=UNDEFINED_TYPE)
ITERATOR_BASE & operator++()
static constexpr int FIRST_TYPE
static constexpr int UNDEFINED_TYPE
Type value to indicate no specific type.
Generic implementation of a flat const/non-const iterator over contained items.
ITEM_CONTAINER * m_parent
Wrapped container
ITERATOR erase(const ITERATOR &aIterator)
int m_curType
Type of the currently iterated items
ITERATOR_BASE< T, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > ITERATOR
The non-const iterator
ITEM_CONTAINER_IT m_it
Iterator for one of the ptr_vector containers stored in the array
boost::ptr_vector< T > ITEM_PTR_VECTOR
Helper for defining a list of library draw object pointers.
ITERATOR_BASE< const T, const MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::const_iterator > CONST_ITERATOR
The const iterator
int last() const
Get last non-empty type or first type if all are empty.
int first() const
Get first non-empty type or first type if all are empty.
ITEM_PTR_VECTOR & operator[](int aType)
void validate()
Assures the iterator is in a valid state.
size_t size(int aType=UNDEFINED_TYPE) const