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