ITK  4.6.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Friends | List of all members
itk::VectorContainer< TElementIdentifier, TElement > Class Template Reference

#include <itkVectorContainer.h>

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

Detailed Description

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

Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.

This is a full-fleged Object, so there is modification time, debug, and reference count information.

Template Parameters
TElementIdentifierAn INTEGRAL type for use in indexing the vector.
TElementThe element type stored in the container.
Wiki Examples:
Examples:
Numerics/FourierDescriptors1.cxx.

Definition at line 51 of file itkVectorContainer.h.

Classes

class  ConstIterator
 
class  Iterator
 

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef TElement Element
 
typedef TElementIdentifier ElementIdentifier
 
typedef SmartPointer< SelfPointer
 
typedef VectorContainer Self
 
typedef VectorType STLContainerType
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

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)
 
- 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 ModifiedTimeType 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 ITK_OVERRIDE
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) ITK_OVERRIDE
 
virtual void UnRegister () const ITK_OVERRIDE
 
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 ()
 

Protected Member Functions

 VectorContainer ()
 
 VectorContainer (size_type n)
 
 VectorContainer (size_type n, const Element &x)
 
 VectorContainer (const Self &r)
 
template<typename TInputIterator >
 VectorContainer (TInputIterator first, TInputIterator last)
 
- 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 ITK_OVERRIDE
 
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 Types

typedef VectorType::size_type size_type
 
typedef VectorType::const_iterator VectorConstIterator
 
typedef VectorType::iterator VectorIterator
 
typedef std::vector< ElementVectorType
 

Friends

class ConstIterator
 
class Iterator
 

Additional Inherited Members

- Protected Types inherited from itk::LightObject
typedef int InternalReferenceCountType
 
- Protected Attributes inherited from itk::LightObject
InternalReferenceCountType m_ReferenceCount
 
SimpleFastMutexLock m_ReferenceCountLock
 
- Private Attributes inherited from std::vector< T >
elements
 

Member Typedef Documentation

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

Definition at line 60 of file itkVectorContainer.h.

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

Definition at line 64 of file itkVectorContainer.h.

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

Save the template parameters.

Definition at line 63 of file itkVectorContainer.h.

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

Definition at line 59 of file itkVectorContainer.h.

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

Standard class typedefs.

Definition at line 57 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
typedef VectorType::size_type itk::VectorContainer< TElementIdentifier, TElement >::size_type
private

Definition at line 69 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
typedef VectorType itk::VectorContainer< TElementIdentifier, TElement >::STLContainerType

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

Definition at line 93 of file itkVectorContainer.h.

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

Definition at line 58 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
typedef VectorType::const_iterator itk::VectorContainer< TElementIdentifier, TElement >::VectorConstIterator
private

Definition at line 71 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
typedef VectorType::iterator itk::VectorContainer< TElementIdentifier, TElement >::VectorIterator
private

Definition at line 70 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
typedef std::vector< Element > itk::VectorContainer< TElementIdentifier, TElement >::VectorType
private

Quick access to the STL vector type that was inherited.

Definition at line 68 of file itkVectorContainer.h.

Constructor & Destructor Documentation

template<typename TElementIdentifier, typename TElement>
itk::VectorContainer< TElementIdentifier, TElement >::VectorContainer ( )
inlineprotected

Provide pass-through constructors corresponding to all the STL vector 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 itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
itk::VectorContainer< TElementIdentifier, TElement >::VectorContainer ( size_type  n)
inlineprotected

Provide pass-through constructors corresponding to all the STL vector constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.

Definition at line 79 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
itk::VectorContainer< TElementIdentifier, TElement >::VectorContainer ( size_type  n,
const Element x 
)
inlineprotected

Provide pass-through constructors corresponding to all the STL vector 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 itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
itk::VectorContainer< TElementIdentifier, TElement >::VectorContainer ( const Self r)
inlineprotected

Provide pass-through constructors corresponding to all the STL vector 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 itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
template<typename TInputIterator >
itk::VectorContainer< TElementIdentifier, TElement >::VectorContainer ( TInputIterator  first,
TInputIterator  last 
)
inlineprotected

Provide pass-through constructors corresponding to all the STL vector constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.

Definition at line 86 of file itkVectorContainer.h.

Member Function Documentation

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

Get a begin const iterator for the vector.

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

Get a begin iterator for the vector.

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

Cast the container to a const STL container type

Definition at line 112 of file itkVectorContainer.h.

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

Cast the container to a STL container type

Definition at line 106 of file itkVectorContainer.h.

template<typename TElementIdentifier, typename TElement>
virtual::itk::LightObject::Pointer itk::VectorContainer< 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::VectorContainer< TElementIdentifier, TElement >::CreateElementAt ( ElementIdentifier  )

Get a reference to the element at the given index. If the element location does not exist, it will be created with a default element value.

It is assumed that the value of the element is modified through the reference.

template<typename TElementIdentifier, typename TElement>
void itk::VectorContainer< TElementIdentifier, TElement >::CreateIndex ( ElementIdentifier  )

Make sure that the index range of the vector is large enough to allow the given index, expanding it if necessary. The index will contain the default element regardless of whether expansion occurred.

template<typename TElementIdentifier, typename TElement>
void itk::VectorContainer< TElementIdentifier, TElement >::DeleteIndex ( ElementIdentifier  )

Delete the element defined by the index identifier. In practice, it doesn't make sense to delete a vector index. Instead, this method just overwrite the index with the default element.

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

Get a reference to the element at the given index. It is assumed that the index exists, and it will not automatically be created.

It is assumed that the value of the element is modified through the reference.

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

Get a reference to the element at the given index. It is assumed that the index exists, and it will not automatically be created.

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

Get an end const iterator for the vector.

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

Get an end iterator for the vector.

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

Read the element from the given index. It is assumed that the index exists.

template<typename TElementIdentifier, typename TElement>
bool itk::VectorContainer< TElementIdentifier, TElement >::GetElementIfIndexExists ( ElementIdentifier  ,
Element  
) const

Check if the given index is in range of the vector. If it is not, 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::VectorContainer< TElementIdentifier, TElement >::GetNameOfClass ( ) const
virtual
template<typename TElementIdentifier, typename TElement>
bool itk::VectorContainer< TElementIdentifier, TElement >::IndexExists ( ElementIdentifier  ) const

Check if the index range of the vector is large enough to allow the given index without expansion.

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

Clear the elements. The final size will be zero.

template<typename TElementIdentifier, typename TElement>
void itk::VectorContainer< TElementIdentifier, TElement >::InsertElement ( ElementIdentifier  ,
Element   
)

Set the element value at the given index. If the element location does not exist, it will be created with a default element value.

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

Method for creation through the object factory.

Referenced by itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::SetBinaryMask().

template<typename TElementIdentifier, typename TElement>
void itk::VectorContainer< 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. In the generic case of ITK containers this is NOT guaranteed to actually allocate any memory, but it is useful if the implementation of the container allocates contiguous storage. In the particular implementation of this VectorContainer the call to this method actually allocates memory for the number of elements defined by ElementIdentifier.

template<typename TElementIdentifier, typename TElement>
void itk::VectorContainer< TElementIdentifier, TElement >::SetElement ( ElementIdentifier  ,
Element   
)

Set the element value at the given index. It is assumed that the index exists.

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

Get the number of elements currently stored in the vector.

template<typename TElementIdentifier, typename TElement>
void itk::VectorContainer< 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. This method is included here mainly for providing a unified API with other containers in the toolkit.

Friends And Related Function Documentation

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

Definition at line 160 of file itkVectorContainer.h.

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

Friends to this class.

Definition at line 159 of file itkVectorContainer.h.


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