18#ifndef itkMapContainer_h
19#define itkMapContainer_h
44template <
typename TElementIdentifier,
typename TElement>
47 ,
private std::map<TElementIdentifier, TElement>
67 using MapType = std::map<ElementIdentifier, Element>;
83 template <
typename TInputIterator>
87 template <
typename TInputIterator>
107 const STLContainerType &
113 using STLContainerType::begin;
114 using STLContainerType::cbegin;
115 using STLContainerType::end;
116 using STLContainerType::cend;
117 using STLContainerType::rbegin;
118 using STLContainerType::crbegin;
119 using STLContainerType::rend;
120 using STLContainerType::crend;
122 using STLContainerType::empty;
123 using STLContainerType::size;
124 using STLContainerType::max_size;
126 using STLContainerType::operator[];
128 using STLContainerType::insert;
129 using STLContainerType::erase;
131 using STLContainerType::clear;
133 using STLContainerType::key_comp;
134 using STLContainerType::value_comp;
136 using STLContainerType::find;
137 using STLContainerType::count;
138 using STLContainerType::lower_bound;
139 using STLContainerType::upper_bound;
140 using STLContainerType::equal_range;
142 using STLContainerType::get_allocator;
144 using typename STLContainerType::key_type;
145 using typename STLContainerType::mapped_type;
146 using typename STLContainerType::value_type;
147 using typename STLContainerType::key_compare;
148 using typename STLContainerType::value_compare;
149 using typename STLContainerType::allocator_type;
150 using typename STLContainerType::reference;
151 using typename STLContainerType::const_reference;
152 using typename STLContainerType::iterator;
153 using typename STLContainerType::const_iterator;
154 using typename STLContainerType::size_type;
155 using typename STLContainerType::difference_type;
156 using typename STLContainerType::pointer;
157 using typename STLContainerType::const_pointer;
158 using typename STLContainerType::reverse_iterator;
159 using typename STLContainerType::const_reverse_iterator;
177 using pointer =
typename MapIterator::pointer;
217 return m_Iter == r.
m_Iter;
225 return m_Iter == r.
m_Iter;
234 return m_Iter->first;
241 return m_Iter->second;
259 using pointer =
typename MapConstIterator::pointer;
302 return m_Iter == r.
m_Iter;
310 return m_Iter == r.
m_Iter;
319 return m_Iter->first;
326 return m_Iter->second;
460#ifndef ITK_MANUAL_INSTANTIATION
461# include "itkMapContainer.hxx"
Light weight base class for most itk classes.
The const iterator type for the map.
ConstIterator(const Iterator &r)
bool operator==(const ConstIterator &r) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ConstIterator)
typename MapConstIterator::iterator_category iterator_category
ConstIterator & operator++()
ConstIterator(const MapConstIterator &ci)
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Iterator)
typename MapConstIterator::pointer pointer
ConstIterator operator--(int)
typename MapConstIterator::reference reference
ConstIterator & operator*()
bool operator==(const Iterator &r) const
typename MapConstIterator::difference_type difference_type
typename MapConstIterator::value_type value_type
const Element & Value() const
ConstIterator operator++(int)
ElementIdentifier Index() const
ConstIterator & operator--()
ConstIterator * operator->()
The non-const iterator type for the map.
typename MapIterator::difference_type difference_type
bool operator==(const ConstIterator &r) const
typename MapIterator::value_type value_type
typename MapIterator::reference reference
typename MapIterator::pointer pointer
bool operator==(const Iterator &r) const
typename MapIterator::iterator_category iterator_category
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Iterator)
Iterator(const MapIterator &i)
ElementIdentifier Index() const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ConstIterator)
A wrapper of the STL "map" container.
bool GetElementIfIndexExists(ElementIdentifier, Element *) const
void InsertElement(ElementIdentifier, Element)
Element & CreateElementAt(ElementIdentifier)
MapContainer(const MapKeyCompareType &comp)
MapContainer(TInputIterator first, TInputIterator last)
ElementIdentifier Size() const
void CreateIndex(ElementIdentifier)
MapContainer(TInputIterator first, TInputIterator last, const MapKeyCompareType &comp)
void SetElement(ElementIdentifier, Element)
Element & ElementAt(ElementIdentifier)
void DeleteIndex(ElementIdentifier)
typename MapType::key_compare MapKeyCompareType
TElementIdentifier ElementIdentifier
Element GetElement(ElementIdentifier) const
std::map< ElementIdentifier, Element > MapType
typename MapType::const_iterator MapConstIterator
void Reserve(ElementIdentifier)
STLContainerType & CastToSTLContainer() noexcept
typename MapType::iterator MapIterator
ConstIterator Begin() const
const Element & ElementAt(ElementIdentifier) const
ConstIterator End() const
bool IndexExists(ElementIdentifier) const
const STLContainerType & CastToSTLConstContainer() const noexcept
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
void swap(Array< T > &a, Array< T > &b) noexcept