KiCad PCB EDA Suite
|
Multivector container type. More...
#include <multivector.h>
Classes | |
class | ITERATOR_BASE |
Generic implementation of a flat const/non-const iterator over contained items.The non-const iterator. More... | |
Public Types | |
typedef boost::ptr_vector< T > | ITEM_PTR_VECTOR |
Helper for defining a list of library draw object pointers. | |
typedef ITERATOR_BASE< T, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::iterator > | ITERATOR |
The const iterator. | |
typedef ITERATOR_BASE< const T, const MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >, typename ITEM_PTR_VECTOR::const_iterator > | CONST_ITERATOR |
Public Member Functions | |
MULTIVECTOR () | |
void | push_back (T *aItem) |
ITERATOR | erase (const ITERATOR &aIterator) |
ITERATOR | begin (int aType=UNDEFINED_TYPE) |
ITERATOR | end (int aType=UNDEFINED_TYPE) |
CONST_ITERATOR | begin (int aType=UNDEFINED_TYPE) const |
CONST_ITERATOR | end (int aType=UNDEFINED_TYPE) const |
void | clear (int aType=UNDEFINED_TYPE) |
size_t | size (int aType=UNDEFINED_TYPE) const |
bool | empty (int aType=UNDEFINED_TYPE) const |
void | sort () |
void | unique () |
Remove duplicate elements in list. | |
ITEM_PTR_VECTOR & | operator[] (int aType) |
const ITEM_PTR_VECTOR & | operator[] (int aType) const |
Static Public Attributes | |
static constexpr int | UNDEFINED_TYPE = 0 |
Type value to indicate no specific type. | |
static constexpr int | FIRST_TYPE = FIRST_TYPE_VAL |
static constexpr int | LAST_TYPE = LAST_TYPE_VAL |
static constexpr int | TYPES_COUNT = LAST_TYPE - FIRST_TYPE + 1 |
Private Member Functions | |
int | first () const |
< Get first non-empty type or first type if all are empty. | |
int | last () const |
Contained items by type. | |
Private Attributes | |
ITEM_PTR_VECTOR | m_data [TYPES_COUNT] |
Multivector container type.
Keeps items segregated by their type in multiple ptr_vectors. Provides both access as a flat list as well as access by type of item.
T is the stored type, needs to provide Type() method used to segregate items. FIRST_TYPE_VAL is the lower boundary value of the types stored in the container. LAST_TYPE_VAL is the upper boundary value of the types stored in the container.
Definition at line 46 of file multivector.h.
typedef ITERATOR_BASE<const T, const MULTIVECTOR<T, FIRST_TYPE_VAL, LAST_TYPE_VAL>, typename ITEM_PTR_VECTOR::const_iterator> MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::CONST_ITERATOR |
Definition at line 168 of file multivector.h.
typedef boost::ptr_vector<T> MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITEM_PTR_VECTOR |
Helper for defining a list of library draw object pointers.
The Boost pointer containers are responsible for deleting object pointers placed in them. If you access a object pointer from the list, do not delete it directly.
Definition at line 65 of file multivector.h.
typedef ITERATOR_BASE<T, MULTIVECTOR<T, FIRST_TYPE_VAL, LAST_TYPE_VAL>, typename ITEM_PTR_VECTOR::iterator> MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR |
The const iterator.
Definition at line 165 of file multivector.h.
|
inline |
Definition at line 171 of file multivector.h.
|
inline |
Definition at line 189 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::first(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::UNDEFINED_TYPE.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), LIB_SYMBOL::Compare(), CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins(), LIB_SYMBOL::SetHasAlternateBodyStyle(), and LIB_SYMBOL::SetUnitCount().
|
inline |
Definition at line 201 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::first(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::UNDEFINED_TYPE.
|
inline |
Definition at line 213 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::operator[](), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::TYPES_COUNT, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::UNDEFINED_TYPE.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), LIB_SYMBOL::deleteAllFields(), and LIB_SYMBOL::operator=().
|
inline |
Definition at line 243 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size().
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::first(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::last(), SCH_IO_KICAD_LEGACY_LIB_CACHE::SaveSymbol(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::validate().
|
inline |
Definition at line 195 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::last(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::UNDEFINED_TYPE.
Referenced by LIB_SYMBOL::Compare(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::operator++(), LIB_SYMBOL::SetHasAlternateBodyStyle(), LIB_SYMBOL::SetUnitCount(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::validate().
|
inline |
Definition at line 207 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::last(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::UNDEFINED_TYPE.
|
inline |
Definition at line 180 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::m_curType, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::m_it, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::m_parent, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::validate().
Referenced by LIB_SYMBOL::RemoveDrawItem(), LIB_SYMBOL::SetHasAlternateBodyStyle(), and LIB_SYMBOL::SetUnitCount().
|
inlineprivate |
< Get first non-empty type or first type if all are empty.
Get last non-empty type or first type if all are empty.
Definition at line 299 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::empty(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::FIRST_TYPE, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::TYPES_COUNT.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin().
|
inlineprivate |
Contained items by type.
Definition at line 310 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::empty(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::FIRST_TYPE, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::TYPES_COUNT.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end().
|
inline |
Definition at line 266 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::FIRST_TYPE, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::LAST_TYPE, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size().
|
inline |
Definition at line 279 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::FIRST_TYPE, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::LAST_TYPE, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data.
|
inline |
Definition at line 175 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::operator[]().
Referenced by LIB_SYMBOL::AddDrawItem(), LIB_SYMBOL::GetPins(), LIB_SYMBOL::LIB_SYMBOL(), LIB_SYMBOL::operator=(), LIB_SYMBOL::SetFields(), LIB_SYMBOL::SetHasAlternateBodyStyle(), and LIB_SYMBOL::SetUnitCount().
|
inline |
Definition at line 226 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::operator[](), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::TYPES_COUNT, and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::UNDEFINED_TYPE.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::empty(), LIB_SYMBOL::GetFieldCount(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::unique().
|
inline |
Definition at line 248 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::TYPES_COUNT.
Referenced by LIB_SYMBOL::AddDrawItem(), SCH_SCREEN::Append(), CADSTAR_SCH_ARCHIVE_LOADER::loadLibrarySymbolShapeVertices(), LIB_SYMBOL::operator=(), SCH_IO_KICAD_LEGACY_LIB_CACHE::SaveSymbol(), LIB_SYMBOL::SetFields(), LIB_SYMBOL::SetHasAlternateBodyStyle(), LIB_SYMBOL::SetUnitCount(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort().
|
inline |
Remove duplicate elements in list.
Definition at line 257 of file multivector.h.
References MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::m_data, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::TYPES_COUNT.
|
staticconstexpr |
Definition at line 293 of file multivector.h.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::first(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::last(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::operator[]().
|
staticconstexpr |
Definition at line 294 of file multivector.h.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::operator[](), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::validate().
|
private |
Definition at line 321 of file multivector.h.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::first(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::last(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::operator[](), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::unique().
|
staticconstexpr |
Definition at line 295 of file multivector.h.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::first(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::last(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::unique().
|
staticconstexpr |
Type value to indicate no specific type.
Mostly used to access the container as a flat list or to return data for the whole container.
Definition at line 53 of file multivector.h.
Referenced by MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::begin(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::clear(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::end(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::ITERATOR_BASE< ITEM_TYPE, ITEM_CONTAINER, ITEM_CONTAINER_IT >::ITERATOR_BASE(), and MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::size().