ITK  4.2.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Friends
itk::MapContainer< TElementIdentifier, TElement > Class Template Reference

#include <itkMapContainer.h>

+ Inheritance diagram for itk::MapContainer< TElementIdentifier, TElement >:
+ Collaboration diagram for itk::MapContainer< TElementIdentifier, TElement >:

List of all members.

Classes

class  ConstIterator
 The const iterator type for the map.

. More...

class  Iterator
 The non-const iterator type for the map.

. More...

Public Types

typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef MapContainer Self
typedef MapType STLContainerType
typedef Object Superclass
- Public Types inherited from itk::Object
- Public Types inherited from itk::LightObject

Public Member Functions

ConstIterator Begin (void) const
Iterator Begin (void)
const STLContainerTypeCastToSTLConstContainer () const
STLContainerTypeCastToSTLContainer ()
virtual ::itk::LightObject::Pointer CreateAnother (void) const
ElementCreateElementAt (ElementIdentifier)
void CreateIndex (ElementIdentifier)
void DeleteIndex (ElementIdentifier)
ElementElementAt (ElementIdentifier)
const ElementElementAt (ElementIdentifier) const
ConstIterator End (void) const
Iterator End (void)
Element GetElement (ElementIdentifier) const
bool GetElementIfIndexExists (ElementIdentifier, Element *) const
virtual const char * GetNameOfClass () const
bool IndexExists (ElementIdentifier) const
void Initialize (void)
void InsertElement (ElementIdentifier, Element)
void Reserve (ElementIdentifier)
void SetElement (ElementIdentifier, Element)
ElementIdentifier Size (void) const
void Squeeze (void)
 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
virtual void DebugOff () const
virtual void DebugOn () const
CommandGetCommand (unsigned long tag)
bool GetDebug () const
MetaDataDictionaryGetMetaDataDictionary (void)
const MetaDataDictionaryGetMetaDataDictionary (void) const
virtual unsigned long GetMTime () const
virtual const TimeStampGetTimeStamp () const
bool HasObserver (const EventObject &event) const
void InvokeEvent (const EventObject &)
void InvokeEvent (const EventObject &) const
virtual void Modified () const
virtual void Register () const
void RemoveAllObservers ()
void RemoveObserver (unsigned long tag)
void SetDebug (bool debugFlag) const
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
virtual void SetReferenceCount (int)
virtual void UnRegister () 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 void SetGlobalWarningDisplay (bool flag)
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()

Private Types

typedef MapType::const_iterator MapConstIterator
typedef MapType::iterator MapIterator
typedef MapType::key_compare MapKeyCompareType
typedef std::map
< ElementIdentifier, Element
MapType

Friends

class ConstIterator
class Iterator
typedef TElementIdentifier ElementIdentifier
typedef TElement Element
 MapContainer (const Self &)
void operator= (const Self &)

Additional Inherited Members

- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
virtual void PrintSelf (std::ostream &os, Indent indent) const
virtual void SetTimeStamp (const TimeStamp &time)
virtual ~Object ()
- 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 ()
- Private Attributes inherited from std::map< K, T >
elements
keys

Detailed Description

template<typename TElementIdentifier, typename TElement>
class itk::MapContainer< TElementIdentifier, TElement >

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.

Template Parameters:
TElementIdentifierA type that shall be used to index the container. It must have a < operator defined for ordering.
TElementThe element type stored in the container.

Definition at line 45 of file itkMapContainer.h.


Member Typedef Documentation

template<typename TElementIdentifier , typename TElement >
typedef SmartPointer< const Self > itk::MapContainer< TElementIdentifier, TElement >::ConstPointer

Reimplemented from itk::Object.

Definition at line 54 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef TElement itk::MapContainer< TElementIdentifier, TElement >::Element

Save the template parameters.

Definition at line 61 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef TElementIdentifier itk::MapContainer< TElementIdentifier, TElement >::ElementIdentifier

Save the template parameters.

Definition at line 57 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef MapType::const_iterator itk::MapContainer< TElementIdentifier, TElement >::MapConstIterator
private

Definition at line 70 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef MapType::iterator itk::MapContainer< TElementIdentifier, TElement >::MapIterator
private

Definition at line 69 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef MapType::key_compare itk::MapContainer< TElementIdentifier, TElement >::MapKeyCompareType
private

Definition at line 71 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef std::map< ElementIdentifier, Element > itk::MapContainer< TElementIdentifier, TElement >::MapType
private

Quick access to the STL map type that was inherited.

Definition at line 68 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef SmartPointer< Self > itk::MapContainer< TElementIdentifier, TElement >::Pointer

Reimplemented from itk::Object.

Definition at line 53 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef MapContainer itk::MapContainer< TElementIdentifier, TElement >::Self

Standard class typedefs.

Reimplemented from itk::Object.

Definition at line 51 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef MapType itk::MapContainer< TElementIdentifier, TElement >::STLContainerType

This type is provided to adapt this container as an STL container

Definition at line 88 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
typedef Object itk::MapContainer< TElementIdentifier, TElement >::Superclass

Reimplemented from itk::Object.

Definition at line 52 of file itkMapContainer.h.


Constructor & Destructor Documentation

template<typename TElementIdentifier , typename TElement >
itk::MapContainer< TElementIdentifier, TElement >::MapContainer ( const Self )
private

Save the template parameters.

template<typename TElementIdentifier , typename TElement >
itk::MapContainer< TElementIdentifier, TElement >::MapContainer ( )
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.

template<typename TElementIdentifier , typename TElement >
itk::MapContainer< TElementIdentifier, TElement >::MapContainer ( const MapKeyCompareType comp)
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 78 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
template<typename TInputIterator >
itk::MapContainer< TElementIdentifier, TElement >::MapContainer ( TInputIterator  first,
TInputIterator  last 
)
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 81 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
template<typename TInputIterator >
itk::MapContainer< TElementIdentifier, TElement >::MapContainer ( TInputIterator  first,
TInputIterator  last,
const MapKeyCompareType comp 
)
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 83 of file itkMapContainer.h.


Member Function Documentation

template<typename TElementIdentifier , typename TElement >
ConstIterator itk::MapContainer< TElementIdentifier, TElement >::Begin ( void  ) const

Get a begin const iterator for the map.

template<typename TElementIdentifier , typename TElement >
Iterator itk::MapContainer< TElementIdentifier, TElement >::Begin ( void  )

Get a begin const iterator for the map.

template<typename TElementIdentifier , typename TElement >
const STLContainerType& itk::MapContainer< TElementIdentifier, TElement >::CastToSTLConstContainer ( ) const
inline

Cast the container to a const STL container type

Definition at line 98 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
STLContainerType& itk::MapContainer< TElementIdentifier, TElement >::CastToSTLContainer ( )
inline

Cast the container to a STL container type

Definition at line 94 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
virtual::itk::LightObject::Pointer itk::MapContainer< TElementIdentifier, TElement >::CreateAnother ( void  ) const
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::Object.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
const Element& itk::MapContainer< TElementIdentifier, TElement >::ElementAt ( ElementIdentifier  ) const

Get a reference to the element at the given index.

template<typename TElementIdentifier , typename TElement >
ConstIterator itk::MapContainer< TElementIdentifier, TElement >::End ( void  ) const

Get an end const iterator for the map.

template<typename TElementIdentifier , typename TElement >
Iterator itk::MapContainer< TElementIdentifier, TElement >::End ( void  )

Get an end const iterator for the map.

template<typename TElementIdentifier , typename TElement >
Element itk::MapContainer< TElementIdentifier, TElement >::GetElement ( ElementIdentifier  ) const

Get the element at the specified index. There is no check for existence performed.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
virtual const char* itk::MapContainer< TElementIdentifier, TElement >::GetNameOfClass ( ) const
virtual

Standard part of every itk Object.

Reimplemented from itk::Object.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
void itk::MapContainer< TElementIdentifier, TElement >::Initialize ( void  )

Tell the container to release any memory it may have allocated and return itself to its initial state.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
static Pointer itk::MapContainer< TElementIdentifier, TElement >::New ( )
static

Method for creation through the object factory.

Reimplemented from itk::Object.

template<typename TElementIdentifier , typename TElement >
void itk::MapContainer< TElementIdentifier, TElement >::operator= ( const Self )
private

Save the template parameters.

Reimplemented from itk::Object.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
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.

template<typename TElementIdentifier , typename TElement >
ElementIdentifier itk::MapContainer< TElementIdentifier, TElement >::Size ( void  ) const

Get the number of elements currently stored in the map.

template<typename TElementIdentifier , typename TElement >
void itk::MapContainer< TElementIdentifier, TElement >::Squeeze ( void  )

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.


Friends And Related Function Documentation

template<typename TElementIdentifier , typename TElement >
friend class ConstIterator
friend

Definition at line 151 of file itkMapContainer.h.

template<typename TElementIdentifier , typename TElement >
friend class Iterator
friend

Definition at line 149 of file itkMapContainer.h.


The documentation for this class was generated from the following file: