OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
otb::ObjectList< TObject > Class Template Reference

#include <otbObjectList.h>

+ Inheritance diagram for otb::ObjectList< TObject >:
+ Collaboration diagram for otb::ObjectList< TObject >:

Classes

class  ConstIterator
 
class  Iterator
 
class  ReverseConstIterator
 
class  ReverseIterator
 

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef InternalContainerType::size_type InternalContainerSizeType
 
typedef std::vector< ObjectPointerTypeInternalContainerType
 
typedef itk::SmartPointer< ObjectTypeObjectPointerType
 
typedef TObject ObjectType
 
typedef itk::SmartPointer< SelfPointer
 
typedef ObjectList Self
 
typedef itk::DataObject Superclass
 

Public Member Functions

InternalContainerSizeType Capacity (void) const
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
void Reserve (InternalContainerSizeType size)
 
void Resize (InternalContainerSizeType size)
 
InternalContainerSizeType Size (void) const override
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ObjectList ()
 
 ~ObjectList () override
 
- Protected Member Functions inherited from otb::DataObjectListInterface
 DataObjectListInterface ()=default
 
virtual ~DataObjectListInterface ()=default
 

Private Member Functions

 ObjectList (const Self &)=delete
 
void operator= (const Self &)=delete
 

Private Attributes

InternalContainerType m_InternalContainer
 

Friends

class ConstIterator
 
class Iterator
 
class ReverseConstIterator
 
class ReverseIterator
 
void PushBack (ObjectType *element)
 
void PopBack (void)
 
void SetNthElement (unsigned int index, ObjectPointerType element)
 
void SetNthElement (unsigned int index, const ObjectType *element)
 
ObjectPointerType GetNthElement (unsigned int index) const
 
SuperclassGetNthDataObject (unsigned int index) const override
 
ObjectPointerType Front (void)
 
ObjectPointerType Back (void)
 
void Erase (unsigned int index)
 
void Clear (void)
 
Iterator Insert (Iterator position, ObjectPointerType element)
 
ReverseIterator Insert (ReverseIterator position, ObjectPointerType element)
 
Iterator Begin (void)
 
ConstIterator Begin (void) const
 
ReverseIterator ReverseBegin (void)
 
ReverseConstIterator ReverseBegin (void) const
 
Iterator End (void)
 
ConstIterator End (void) const
 
ReverseIterator ReverseEnd (void)
 
ReverseConstIterator ReverseEnd (void) const
 
void Erase (Iterator begin, Iterator end)
 
void Erase (Iterator loc)
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 

Detailed Description

template<class TObject>
class otb::ObjectList< TObject >

This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.

ObjectList stores SmartPointer to ObjectType in a std::vector data structure. It provides the same methods and iterators interfaces.

Definition at line 40 of file otbObjectList.h.

Member Typedef Documentation

◆ ConstPointer

template<class TObject >
typedef itk::SmartPointer<const Self> otb::ObjectList< TObject >::ConstPointer

Definition at line 47 of file otbObjectList.h.

◆ InternalContainerSizeType

template<class TObject >
typedef InternalContainerType::size_type otb::ObjectList< TObject >::InternalContainerSizeType

Definition at line 59 of file otbObjectList.h.

◆ InternalContainerType

template<class TObject >
typedef std::vector<ObjectPointerType> otb::ObjectList< TObject >::InternalContainerType

Definition at line 58 of file otbObjectList.h.

◆ ObjectPointerType

template<class TObject >
typedef itk::SmartPointer<ObjectType> otb::ObjectList< TObject >::ObjectPointerType

Definition at line 57 of file otbObjectList.h.

◆ ObjectType

template<class TObject >
typedef TObject otb::ObjectList< TObject >::ObjectType

Template parameter typedefs

Definition at line 53 of file otbObjectList.h.

◆ Pointer

template<class TObject >
typedef itk::SmartPointer<Self> otb::ObjectList< TObject >::Pointer

Definition at line 46 of file otbObjectList.h.

◆ Self

template<class TObject >
typedef ObjectList otb::ObjectList< TObject >::Self

Standard typedefs

Definition at line 44 of file otbObjectList.h.

◆ Superclass

template<class TObject >
typedef itk::DataObject otb::ObjectList< TObject >::Superclass

Definition at line 45 of file otbObjectList.h.

Constructor & Destructor Documentation

◆ ObjectList() [1/2]

template<class TObject >
otb::ObjectList< TObject >::ObjectList
protected

Constructor

Definition at line 33 of file otbObjectList.hxx.

◆ ~ObjectList()

template<class TObject >
otb::ObjectList< TObject >::~ObjectList ( )
inlineoverrideprotected

Destructor

Definition at line 668 of file otbObjectList.h.

◆ ObjectList() [2/2]

template<class TObject >
otb::ObjectList< TObject >::ObjectList ( const Self )
privatedelete

Member Function Documentation

◆ Back()

template<class TObject >
ObjectList< TObject >::ObjectPointerType otb::ObjectList< TObject >::Back ( void  )

Return the last element of the list.

Returns
The last element of the list.

Definition at line 177 of file otbObjectList.hxx.

◆ Begin() [1/2]

template<class TObject >
ObjectList< TObject >::Iterator otb::ObjectList< TObject >::Begin ( void  )

Get an Iterator that points to the beginning of the container.

Returns
The iterator.

Definition at line 237 of file otbObjectList.hxx.

Referenced by otb::ImageFittingPolygonListFilter< TPath, TImage >::GenerateData().

◆ Begin() [2/2]

template<class TObject >
ObjectList< TObject >::ConstIterator otb::ObjectList< TObject >::Begin ( void  ) const

Get a ConstIterator that points to the beginning of the container.

Returns
The iterator.

Definition at line 248 of file otbObjectList.hxx.

◆ Capacity()

template<class TObject >
ObjectList< TObject >::InternalContainerSizeType otb::ObjectList< TObject >::Capacity ( void  ) const

Get the capacity of the vector.

Returns
The capacity of the vector.

Definition at line 52 of file otbObjectList.hxx.

◆ Clear()

template<class TObject >
void otb::ObjectList< TObject >::Clear ( void  )

◆ CreateAnother()

template<class TObject >
virtual::itk::LightObject::Pointer otb::ObjectList< TObject >::CreateAnother ( void  ) const

◆ End() [1/2]

template<class TObject >
ObjectList< TObject >::Iterator otb::ObjectList< TObject >::End ( void  )

Get an Iterator that points past-the-end of the container.

Returns
The iterator.

Definition at line 281 of file otbObjectList.hxx.

Referenced by otb::ImageFittingPolygonListFilter< TPath, TImage >::GenerateData().

◆ End() [2/2]

template<class TObject >
ObjectList< TObject >::ConstIterator otb::ObjectList< TObject >::End ( void  ) const

Get a ConstIterator that points past-the-end of the container.

Returns
The iterator.

Definition at line 292 of file otbObjectList.hxx.

◆ Erase() [1/3]

template<class TObject >
void otb::ObjectList< TObject >::Erase ( Iterator  begin,
Iterator  end 
)

Erase elements from begin to last.

Parameters
beginIterator pointing on first object to erase.
endIterator pointing past the last object to erase.

Definition at line 326 of file otbObjectList.hxx.

◆ Erase() [2/3]

template<class TObject >
void otb::ObjectList< TObject >::Erase ( Iterator  loc)

Erase loc element.

Parameters
locIterator pointing on object to erase.

Definition at line 337 of file otbObjectList.hxx.

◆ Erase() [3/3]

template<class TObject >
void otb::ObjectList< TObject >::Erase ( unsigned int  index)

Erase the nth element of the list.

Parameters
indexThe index of the element to erase.

Erase the nth element in the list.

Parameters
indexThe index of the element to erase.

Definition at line 187 of file otbObjectList.hxx.

◆ Front()

template<class TObject >
ObjectList< TObject >::ObjectPointerType otb::ObjectList< TObject >::Front ( void  )

Return the first element of the list.

Returns
The first element of the list.

Definition at line 168 of file otbObjectList.hxx.

◆ GetNameOfClass()

template<class TObject >
virtual const char* otb::ObjectList< TObject >::GetNameOfClass ( ) const
virtual

Type macro

◆ GetNthDataObject()

template<class TObject >
ObjectList< TObject >::Superclass * otb::ObjectList< TObject >::GetNthDataObject ( unsigned int  index) const
overridevirtual

Get the nth element of the list as a DataObject *.

Parameters
indexThe index of the object to get.

Implements otb::DataObjectListInterface.

Definition at line 156 of file otbObjectList.hxx.

◆ GetNthElement()

template<class TObject >
ObjectList< TObject >::ObjectPointerType otb::ObjectList< TObject >::GetNthElement ( unsigned int  index) const

◆ Insert() [1/2]

template<class TObject >
ObjectList< TObject >::Iterator otb::ObjectList< TObject >::Insert ( Iterator  position,
ObjectPointerType  element 
)

Insert an element at a given position

Parameters
positionA random access iterator
Returns
An iterator that points to the newly insereted element.

Insert an element

Definition at line 212 of file otbObjectList.hxx.

◆ Insert() [2/2]

template<class TObject >
ObjectList< TObject >::ReverseIterator otb::ObjectList< TObject >::Insert ( ReverseIterator  position,
ObjectPointerType  element 
)

Insert an element at a given position

Parameters
positionA reverse iterator
Returns
A reverse iterator that points to the newly insereted element.

Insert an element

Definition at line 224 of file otbObjectList.hxx.

◆ New()

template<class TObject >
static Pointer otb::ObjectList< TObject >::New ( )
static

Creation through object factory macro

◆ operator=()

template<class TObject >
void otb::ObjectList< TObject >::operator= ( const Self )
privatedelete

◆ PopBack()

template<class TObject >
void otb::ObjectList< TObject >::PopBack ( void  )

Delete the last element to the list.

Definition at line 93 of file otbObjectList.hxx.

◆ PrintSelf()

template<class TObject >
void otb::ObjectList< TObject >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

Definition at line 346 of file otbObjectList.hxx.

◆ PushBack()

template<class TObject >
void otb::ObjectList< TObject >::PushBack ( ObjectType element)

◆ Reserve()

template<class TObject >
void otb::ObjectList< TObject >::Reserve ( InternalContainerSizeType  size)

Set the minimum capacity of the vector.

Parameters
sizeSize of the vector to reserve.

Definition at line 42 of file otbObjectList.hxx.

◆ Resize()

template<class TObject >
void otb::ObjectList< TObject >::Resize ( InternalContainerSizeType  size)

Resize the maximal list capacity.

Parameters
sizeThe new maximal size of the list.

Definition at line 72 of file otbObjectList.hxx.

◆ ReverseBegin() [1/2]

template<class TObject >
ObjectList< TObject >::ReverseIterator otb::ObjectList< TObject >::ReverseBegin ( void  )

Get a ReverseIterator that points to the reverse beginning of the container.

Returns
The iterator.

Definition at line 259 of file otbObjectList.hxx.

◆ ReverseBegin() [2/2]

template<class TObject >
ObjectList< TObject >::ReverseConstIterator otb::ObjectList< TObject >::ReverseBegin ( void  ) const

Get a ReverseConstIterator that points to the reverse beginning of the container.

Returns
The iterator.

Definition at line 270 of file otbObjectList.hxx.

◆ ReverseEnd() [1/2]

template<class TObject >
ObjectList< TObject >::ReverseIterator otb::ObjectList< TObject >::ReverseEnd ( void  )

Get a ReverseIterator that points to the reverse past-the-end of the container.

Returns
The iterator.

Definition at line 303 of file otbObjectList.hxx.

◆ ReverseEnd() [2/2]

template<class TObject >
ObjectList< TObject >::ReverseConstIterator otb::ObjectList< TObject >::ReverseEnd ( void  ) const

Get a ReverseConstIterator that points to the reverse past-the-end of the container.

Returns
The iterator.

Definition at line 314 of file otbObjectList.hxx.

◆ SetNthElement() [1/2]

template<class TObject >
void otb::ObjectList< TObject >::SetNthElement ( unsigned int  index,
const ObjectType element 
)

Set the nth element of the list.

Parameters
indexThe index where to put the element.
elementPointer to the element to set.

Definition at line 126 of file otbObjectList.hxx.

◆ SetNthElement() [2/2]

template<class TObject >
void otb::ObjectList< TObject >::SetNthElement ( unsigned int  index,
ObjectPointerType  element 
)

Set the nth element of the list.

Parameters
indexThe index where to put the element.
elementPointer to the element to set.

Definition at line 109 of file otbObjectList.hxx.

◆ Size()

template<class TObject >
ObjectList< TObject >::InternalContainerSizeType otb::ObjectList< TObject >::Size ( void  ) const
overridevirtual

Friends And Related Function Documentation

◆ ConstIterator

template<class TObject >
friend class ConstIterator
friend

Definition at line 145 of file otbObjectList.h.

◆ Iterator

template<class TObject >
friend class Iterator
friend

Definition at line 143 of file otbObjectList.h.

◆ ReverseConstIterator

template<class TObject >
friend class ReverseConstIterator
friend

Definition at line 147 of file otbObjectList.h.

◆ ReverseIterator

template<class TObject >
friend class ReverseIterator
friend

Definition at line 146 of file otbObjectList.h.

Member Data Documentation

◆ m_InternalContainer

template<class TObject >
InternalContainerType otb::ObjectList< TObject >::m_InternalContainer
private

The internal std::vector object container

Definition at line 679 of file otbObjectList.h.


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