BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Public Types | Public Member Functions | Static Public Member Functions
btk::Collection< T > Class Template Reference

List of objects. More...

#include <btkCollection.h>

Inheritance diagram for btk::Collection< T >:
Inheritance graph
[legend]

Public Types

typedef std::list< ItemPointer >
::const_iterator 
ConstIterator
 
typedef btkSharedPtr< const
Collection
ConstPointer
 
typedef T::ConstPointer ItemConstPointer
 
typedef T::Pointer ItemPointer
 
typedef std::list< ItemPointer >
::iterator 
Iterator
 
typedef btkNullPtr< CollectionNullPointer
 
typedef btkSharedPtr< CollectionPointer
 
- Public Types inherited from btk::DataObject
typedef btkSharedPtr< const
DataObject
ConstPointer
 
typedef btkNullPtr< DataObjectNullPointer
 
typedef btkSharedPtr< DataObjectPointer
 
- Public Types inherited from btk::Object
typedef btkSharedPtr< const
Object
ConstPointer
 
typedef btkSharedPtr< ObjectPointer
 

Public Member Functions

Iterator Begin ()
 
ConstIterator Begin () const
 
void Clear ()
 
Pointer Clone () const
 
Iterator End ()
 
ConstIterator End () const
 
ItemPointer GetBackItem ()
 
ItemConstPointer GetBackItem () const
 
ItemPointer GetFrontItem ()
 
ItemConstPointer GetFrontItem () const
 
int GetIndexOf (ItemPointer elt) const
 
ItemPointer GetItem (int idx)
 
ItemConstPointer GetItem (int idx) const
 
int GetItemNumber () const
 
bool InsertItem (Iterator loc, ItemPointer elt)
 
bool InsertItem (int idx, ItemPointer elt)
 
bool InsertItem (ItemPointer elt)
 
bool IsEmpty () const
 
Iterator RemoveItem (Iterator loc)
 
void RemoveItem (int idx)
 
bool SetItem (int idx, ItemPointer elt)
 
void SetItemNumber (int num)
 
ItemPointer TakeItem (Iterator loc)
 
ItemPointer TakeItem (int idx)
 
virtual ~Collection ()
 
- Public Member Functions inherited from btk::DataObject
DataObjectGetParent () const
 
bool HasParent () const
 
void Modified ()
 
void SetParent (DataObject *parent)
 
void Update ()
 
- Public Member Functions inherited from btk::Object
unsigned long int GetTimestamp () const
 

Static Public Member Functions

static Pointer New ()
 
static NullPointer Null ()
 
- Static Public Member Functions inherited from btk::DataObject
static NullPointer Null ()
 

Additional Inherited Members

- Protected Member Functions inherited from btk::DataObject
 DataObject ()
 
 DataObject (const DataObject &toCopy)
 
virtual ~DataObject ()
 
- Protected Member Functions inherited from btk::Object
 Object ()
 
 Object (const Object &toCopy)
 
virtual ~Object ()
 
- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

template<class T>
class btk::Collection< T >

List of objects.

Member Typedef Documentation

template<class T>
btk::Collection< T >::ConstIterator

Const iterator for items contained in the Collection object.

template<class T>
btk::Collection< T >::ConstPointer

Smart pointer associated with a const Collection object.

template<class T>
btk::Collection< T >::ItemConstPointer

Smart pointer associated with a const T object.

template<class T>
btk::Collection< T >::ItemPointer

Smart pointer associated with a T object.

template<class T>
btk::Collection< T >::Iterator

Iterator for items contained in the Collection object.

template<class T>
btk::Collection< T >::NullPointer

Special null pointer associated with a Collection object. This type should be used only internally to test the nullity of a smart pointer. See the static method Null() instead.

template<class T>
btk::Collection< T >::Pointer

Smart pointer associated with a Collection object.

Constructor & Destructor Documentation

template<class T>
template< class T > virtual btk::Collection< T >::~Collection ( )
inlinevirtual

Empty destructor.

Member Function Documentation

template<class T>
template< class T > Collection< T >::Iterator btk::Collection< T >::Begin ( )
inline

Returns an iterator to the beginning of the list of items.

template<class T>
template< class T > Collection< T >::ConstIterator btk::Collection< T >::Begin ( ) const
inline

Returns a const iterator to the beginning of the list of items.

template<class T >
void btk::Collection< T >::Clear ( )

Clear the contents of the list.

template<class T >
btkSharedPtr< Collection< T > > btk::Collection< T >::Clone ( ) const

Deep copy.

template<class T>
template< class T > Collection< T >::Iterator btk::Collection< T >::End ( )
inline

Returns an iterator just past the last item.

template<class T>
template< class T > Collection< T >::ConstIterator btk::Collection< T >::End ( ) const
inline

Returns a const iterator just past the last item.

template<class T>
template< class T > ItemPointer btk::Collection< T >::GetBackItem ( )
inline

Returns the item in back of the list.

template<class T>
template< class T > ItemConstPointer btk::Collection< T >::GetBackItem ( ) const
inline

Returns the item in back of the list.

template<class T>
template< class T > ItemPointer btk::Collection< T >::GetFrontItem ( )
inline

Returns the item in front of the list.

template<class T>
template< class T > ItemConstPointer btk::Collection< T >::GetFrontItem ( ) const
inline

Returns the item in front of the list.

template<class T >
int btk::Collection< T >::GetIndexOf ( ItemPointer  elt) const

Return the index associated with the item elt or -1 if not found

template<class T >
T::Pointer btk::Collection< T >::GetItem ( int  idx)

Returns a smart pointer of the object located at the index idx.

template<class T >
T::ConstPointer btk::Collection< T >::GetItem ( int  idx) const

Returns a const smart pointer of the object located at the index idx.

template<class T>
template< class T > int btk::Collection< T >::GetItemNumber ( ) const
inline

Returns the number of items in the list.

template<class T >
bool btk::Collection< T >::InsertItem ( Iterator  loc,
ItemPointer  elt 
)

Inserts the smart pointer elt in the list at the location loc.

Returns
True if elt has been inserted or false otherwise.
template<class T >
bool btk::Collection< T >::InsertItem ( int  idx,
ItemPointer  elt 
)

Inserts the smart pointer elt in the list at the index idx.

Returns
True if elt has been inserted or false otherwise.
template<class T>
template< class T > bool btk::Collection< T >::InsertItem ( ItemPointer  elt)
inline

Inserts the smart pointer elt at the end of the list.

Returns
True if elt has been inserted or false otherwise.
template<class T>
template< class T > bool btk::Collection< T >::IsEmpty ( ) const
inline

Returns true if the collection is empty.

template<class T>
template< class T > static Pointer btk::Collection< T >::New ( )
inlinestatic

Creates a smart pointer associated with a Collection<T> object.

template<class T>
static NullPointer btk::Collection< T >::Null ( )
inlinestatic

Static function to return a null pointer.

Note
This static method should be used only to test if a shared ponter is null or not. It is advised to call the method without parenthesis as special (in)equality operator are implemented to use a function pointer. See the description of the class NullPtr for an example.
template<class T >
std::list< typename T::Pointer >::iterator btk::Collection< T >::RemoveItem ( Iterator  loc)

Removes the item at the location loc.

template<class T >
void btk::Collection< T >::RemoveItem ( int  idx)

Removes the item at the index idx.

template<class T >
bool btk::Collection< T >::SetItem ( int  idx,
ItemPointer  elt 
)

Sets the smart pointer elt in the list at the index idx.

Returns
True if elt has been assigned or false otherwise.
template<class T >
void btk::Collection< T >::SetItemNumber ( int  num)

Sets the number of items in the list.

template<class T >
T::Pointer btk::Collection< T >::TakeItem ( Iterator  loc)

Removes the item at the location loc and return it.

template<class T >
T::Pointer btk::Collection< T >::TakeItem ( int  idx)

Removes the item at the index idx and return it.