ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkMapContainer.h>
A wrapper of the STL "map" container.
Define a front-end to the STL "map" container that conforms to the IndexedContainerInterface. This is a full-fleged Object, so there are events, modification time, debug, and reference count information.
TElementIdentifier | A type that shall be used to index the container. It must have a < operator defined for ordering. |
TElement | The element type stored in the container. |
Definition at line 45 of file itkMapContainer.h.
Classes | |
class | ConstIterator |
class | Iterator |
Public Types | |
using | ConstPointer = SmartPointer< const Self > |
using | Element = TElement |
using | ElementIdentifier = TElementIdentifier |
using | Pointer = SmartPointer< Self > |
using | Self = MapContainer |
using | STLContainerType = MapType |
using | Superclass = Object |
Public Types inherited from itk::Object | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = Object |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Public Member Functions | |
ConstIterator | Begin () const |
Iterator | Begin () |
const STLContainerType & | CastToSTLConstContainer () const noexcept |
STLContainerType & | CastToSTLContainer () noexcept |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
Element & | CreateElementAt (ElementIdentifier) |
void | CreateIndex (ElementIdentifier) |
void | DeleteIndex (ElementIdentifier) |
Element & | ElementAt (ElementIdentifier) |
const Element & | ElementAt (ElementIdentifier) const |
ConstIterator | End () const |
Iterator | End () |
Element | GetElement (ElementIdentifier) const |
bool | GetElementIfIndexExists (ElementIdentifier, Element *) const |
virtual const char * | GetNameOfClass () const |
bool | IndexExists (ElementIdentifier) const |
void | Initialize () |
void | InsertElement (ElementIdentifier, Element) |
void | Reserve (ElementIdentifier) |
void | SetElement (ElementIdentifier, Element) |
ElementIdentifier | Size () const |
void | Squeeze () |
MapContainer () | |
MapContainer (const MapKeyCompareType &comp) | |
template<typename TInputIterator > | |
MapContainer (TInputIterator first, TInputIterator last) | |
template<typename TInputIterator > | |
MapContainer (TInputIterator first, TInputIterator last, const MapKeyCompareType &comp) | |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
LightObject::Pointer | CreateAnother () const override |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexceptoverride |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
itkCloneMacro (Self) | |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Private Types | |
using | MapConstIterator = typename MapType::const_iterator |
using | MapIterator = typename MapType::iterator |
using | MapKeyCompareType = typename MapType::key_compare |
using | MapType = std::map< ElementIdentifier, Element > |
Friends | |
class | ConstIterator |
class | Iterator |
Additional Inherited Members | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetTimeStamp (const TimeStamp &time) |
~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
Private Attributes inherited from std::map< K, T > | |
T | elements |
K | keys |
using itk::MapContainer< TElementIdentifier, TElement >::ConstPointer = SmartPointer< const Self > |
Definition at line 56 of file itkMapContainer.h.
using itk::MapContainer< TElementIdentifier, TElement >::Element = TElement |
Definition at line 63 of file itkMapContainer.h.
using itk::MapContainer< TElementIdentifier, TElement >::ElementIdentifier = TElementIdentifier |
Save the template parameters.
Definition at line 62 of file itkMapContainer.h.
|
private |
Definition at line 69 of file itkMapContainer.h.
|
private |
Definition at line 68 of file itkMapContainer.h.
|
private |
Definition at line 70 of file itkMapContainer.h.
|
private |
Quick access to the STL map type that was inherited.
Definition at line 67 of file itkMapContainer.h.
using itk::MapContainer< TElementIdentifier, TElement >::Pointer = SmartPointer< Self > |
Definition at line 55 of file itkMapContainer.h.
using itk::MapContainer< TElementIdentifier, TElement >::Self = MapContainer |
Standard class type aliases.
Definition at line 53 of file itkMapContainer.h.
using itk::MapContainer< TElementIdentifier, TElement >::STLContainerType = MapType |
This type is provided to adapt this container as an STL container
Definition at line 90 of file itkMapContainer.h.
using itk::MapContainer< TElementIdentifier, TElement >::Superclass = Object |
Definition at line 54 of file itkMapContainer.h.
|
inline |
Provide pass-through constructors corresponding to all the STL map constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.
Definition at line 76 of file itkMapContainer.h.
|
inline |
Provide pass-through constructors corresponding to all the STL map constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.
Definition at line 77 of file itkMapContainer.h.
|
inline |
Provide pass-through constructors corresponding to all the STL map constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.
Definition at line 80 of file itkMapContainer.h.
|
inline |
Provide pass-through constructors corresponding to all the STL map constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.
Definition at line 82 of file itkMapContainer.h.
ConstIterator itk::MapContainer< TElementIdentifier, TElement >::Begin | ( | ) | const |
Get a begin const iterator for the map.
Iterator itk::MapContainer< TElementIdentifier, TElement >::Begin | ( | ) |
Get a begin const iterator for the map.
|
inlinenoexcept |
Cast the container to a const STL container type
Definition at line 99 of file itkMapContainer.h.
|
inlinenoexcept |
Cast the container to a STL container type
Definition at line 93 of file itkMapContainer.h.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightObject.
Element& itk::MapContainer< TElementIdentifier, TElement >::CreateElementAt | ( | ElementIdentifier | ) |
Get a reference to the element at the given index. If the index does not exist, it is created automatically.
It is assumed that the value of the element is modified through the reference.
void itk::MapContainer< TElementIdentifier, TElement >::CreateIndex | ( | ElementIdentifier | ) |
The map will create an entry for a given index through the indexing operator. Whether or not it is created, it will be assigned to the default element.
void itk::MapContainer< TElementIdentifier, TElement >::DeleteIndex | ( | ElementIdentifier | ) |
Delete the entry in the STL map corresponding to the given identifier. If the entry does not exist, nothing happens.
Element& itk::MapContainer< TElementIdentifier, TElement >::ElementAt | ( | ElementIdentifier | ) |
Get a reference to the element at the given index. If the index does not exist, it is created automatically.
It is assumed that the value of the element is modified through the reference.
const Element& itk::MapContainer< TElementIdentifier, TElement >::ElementAt | ( | ElementIdentifier | ) | const |
Get a reference to the element at the given index.
ConstIterator itk::MapContainer< TElementIdentifier, TElement >::End | ( | ) | const |
Get an end const iterator for the map.
Iterator itk::MapContainer< TElementIdentifier, TElement >::End | ( | ) |
Get an end const iterator for the map.
Element itk::MapContainer< TElementIdentifier, TElement >::GetElement | ( | ElementIdentifier | ) | const |
Get the element at the specified index. There is no check for existence performed.
bool itk::MapContainer< TElementIdentifier, TElement >::GetElementIfIndexExists | ( | ElementIdentifier | , |
Element * | |||
) | const |
If the given index doesn't exist in the map, return false. Otherwise, set the element through the pointer (if it isn't null), and return true.
|
virtual |
Standard part of every itk Object.
Reimplemented from itk::Object.
bool itk::MapContainer< TElementIdentifier, TElement >::IndexExists | ( | ElementIdentifier | ) | const |
Check if the STL map has an entry corresponding to the given index. The count will be either 1 or 0.
void itk::MapContainer< TElementIdentifier, TElement >::Initialize | ( | ) |
Tell the container to release any memory it may have allocated and return itself to its initial state.
void itk::MapContainer< TElementIdentifier, TElement >::InsertElement | ( | ElementIdentifier | , |
Element | |||
) |
Set the given index value to the given element. If the index doesn't exist, it is automatically created.
|
static |
Method for creation through the object factory.
void itk::MapContainer< TElementIdentifier, TElement >::Reserve | ( | ElementIdentifier | ) |
Tell the container to allocate enough memory to allow at least as many elements as the size given to be stored. This is NOT guaranteed to actually allocate any memory, but is useful if the implementation of the container allocates contiguous storage.
void itk::MapContainer< TElementIdentifier, TElement >::SetElement | ( | ElementIdentifier | , |
Element | |||
) |
Set the given index value to the given element. If the index doesn't exist, it is automatically created.
ElementIdentifier itk::MapContainer< TElementIdentifier, TElement >::Size | ( | ) | const |
Get the number of elements currently stored in the map.
void itk::MapContainer< TElementIdentifier, TElement >::Squeeze | ( | ) |
Tell the container to try to minimize its memory usage for storage of the current number of elements. This is NOT guaranteed to decrease memory usage.
|
friend |
Definition at line 152 of file itkMapContainer.h.
|
friend |
Definition at line 150 of file itkMapContainer.h.