FUTrackedList< ObjectClass > Class Template Reference
[Utility Classes.]

An object list. More...

#include <FUTracker.h>

Inheritance diagram for FUTrackedList< ObjectClass >:

fm::pvector< ObjectClass > FUTracker List of all members.

Public Types

typedef fm::pvector< ObjectClass > Parent
 Defines the parent class to the pointer array.
typedef ObjectClass * item
 Defines the item pointer type contained by the pointer array.
typedef const ObjectClass * const_item
 Defines the constant-version of the item pointer type contained by the pointer array.
typedef itemiterator
 Defines the item pointer iterator for the pointer array.
typedef const_itemconst_iterator
 Defines the constant-version of the item pointer iterator for the pointer array.

Public Member Functions

virtual ~FUTrackedList ()
 Destructor.
void clear ()
 Clears the object tracked by this object list.
ObjectClass *& front ()
 Retrieves the first element of the container.
const ObjectClass *& front () const
 See above.
ObjectClass *& back ()
 Retrieves the last element of the container.
const ObjectClass *& back () const
 See above.
ObjectClass * at (size_t index)
 Retrieves an indexed object in the list.
const ObjectClass * at (size_t index) const
 See above.
template<class INTEGER>
ObjectClass * operator[] (INTEGER index)
 See above.
template<class INTEGER>
const ObjectClass * operator[] (INTEGER index) const
 See above.
iterator begin ()
 Retrieves an iterator for the first element in the list.
const_iterator begin () const
 See above.
iterator end ()
 Retrieves an iterator for the element after the last element in the list.
const_iterator end () const
 See above.
iterator find (const ObjectClass *item)
 Retrieves an iterator for a given element in the list.
const_iterator find (const ObjectClass *item) const
 See above.
void push_back (ObjectClass *object)
 Adds an object to the container's containment list.
iterator insert (iterator _iterator, ObjectClass *object)
 Inserts an object in the container's containment list.
void insert (size_t index, ObjectClass *object)
 Inserts an object in the container's containment list.
template<class _It>
void insert (iterator _where, _It _startIterator, _It _endIterator)
 Inserts a list of object in the container's containment list.
void pop_back ()
 Removes the last value of the tracked object list.
iterator erase (iterator _it)
 Removes the value at the given position within the list.
void erase (iterator first, iterator last)
 Removes a range of values from the list.
void erase (size_t first, size_t last)
 Removes a range of values from the list.
bool erase (const ObjectClass *value)
 Removes a value contained within the list, once.
void erase (size_t index)
 Removes an indexed value contained within the list.
virtual bool TracksObject (const FUTrackable *object) const
 Retrieves whether an object is contained by this container.
FUTrackedList< ObjectClass > & operator= (const FUTrackedList< ObjectClass > &other)
 Clones a list of tracked objects.
bool empty () const
 Inherited from pvector.
size_t size () const
 Inherited from pvector.
void reserve (size_t count)
 Inherited from pvector.
bool contains (const ObjectClass *value) const
 Inherited from pvector.
bool release (const ObjectClass *value)
 Releases a value contained within a list.
void pop_front ()
 Removes the first value of the tracked object list.

Protected Member Functions

virtual void OnObjectReleased (FUTrackable *object)
 Removes an object from the container's containment list.

Detailed Description

template<class ObjectClass = FUTrackable>
class FUTrackedList< ObjectClass >

An object list.

Based on top of our modified version of the STL vector class, this contained object list holds pointers to some FUTrackable derived class and automatically removes objects when they are deleted.


Member Function Documentation

template<class ObjectClass = FUTrackable>
ObjectClass* FUTrackedList< ObjectClass >::at size_t  index  )  [inline]
 

Retrieves an indexed object in the list.

Parameters:
index An index.
Returns:
The given object.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
ObjectClass*& FUTrackedList< ObjectClass >::back  )  [inline]
 

Retrieves the last element of the container.

Returns:
The last element in the container.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
iterator FUTrackedList< ObjectClass >::begin  )  [inline]
 

Retrieves an iterator for the first element in the list.

Returns:
an iterator for the first element in the list.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
iterator FUTrackedList< ObjectClass >::end  )  [inline]
 

Retrieves an iterator for the element after the last element in the list.

Returns:
an iterator for the element after the last element in the list.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
void FUTrackedList< ObjectClass >::erase size_t  index  )  [inline]
 

Removes an indexed value contained within the list.

Parameters:
index The index of the value to erase.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
bool FUTrackedList< ObjectClass >::erase const ObjectClass *  value  )  [inline]
 

Removes a value contained within the list, once.

Parameters:
value The value, contained within the list, to erase from it.
Returns:
Whether the value was found and erased from the list.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
void FUTrackedList< ObjectClass >::erase size_t  first,
size_t  last
[inline]
 

Removes a range of values from the list.

Parameters:
first The index of the first value to remove.
last The index just passed the last value to remove.

Reimplemented from fm::vector< const void *, true >.

template<class ObjectClass = FUTrackable>
void FUTrackedList< ObjectClass >::erase iterator  first,
iterator  last
[inline]
 

Removes a range of values from the list.

Parameters:
first The list position of the first value to remove.
last The list position just passed the last value to remove.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
iterator FUTrackedList< ObjectClass >::erase iterator  _it  )  [inline]
 

Removes the value at the given position within the list.

Parameters:
_it The list position for the value to remove.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
iterator FUTrackedList< ObjectClass >::find const ObjectClass *  item  )  [inline]
 

Retrieves an iterator for a given element in the list.

Parameters:
item An item of the list.
Returns:
An iterator for the given item. If the item is not found in the list, the end() iterator is returned.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
ObjectClass*& FUTrackedList< ObjectClass >::front  )  [inline]
 

Retrieves the first element of the container.

Returns:
The first element in the container.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
template<class _It>
void FUTrackedList< ObjectClass >::insert iterator  _where,
_It  _startIterator,
_It  _endIterator
[inline]
 

Inserts a list of object in the container's containment list.

Parameters:
_where The iterator after which to insert the object.
_startIterator The iterator for the first object to insert.
_endIterator The iterator just passed the last object. This object will not be inserted.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
void FUTrackedList< ObjectClass >::insert size_t  index,
ObjectClass *  object
[inline]
 

Inserts an object in the container's containment list.

Parameters:
index Where to insert the object.
object An object to insert.

template<class ObjectClass = FUTrackable>
iterator FUTrackedList< ObjectClass >::insert iterator  _iterator,
ObjectClass *  object
[inline]
 

Inserts an object in the container's containment list.

Parameters:
_iterator The iterator after which to insert the object.
object An object to insert.
Returns:
The iterator to the inserted object.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
virtual void FUTrackedList< ObjectClass >::OnObjectReleased FUTrackable object  )  [inline, protected, virtual]
 

Removes an object from the container's containment list.

Parameters:
object A contained object.

Implements FUTracker.

template<class ObjectClass = FUTrackable>
FUTrackedList<ObjectClass>& FUTrackedList< ObjectClass >::operator= const FUTrackedList< ObjectClass > &  other  )  [inline]
 

Clones a list of tracked objects.

This list will stop tracking all its current tracked objects and will start tracking the objects within the other list.

Parameters:
other A second list of tracked objects.
Returns:
This list.

template<class ObjectClass = FUTrackable>
void FUTrackedList< ObjectClass >::push_back ObjectClass *  object  )  [inline]
 

Adds an object to the container's containment list.

Parameters:
object An object to contain.

template<class ObjectClass = FUTrackable>
bool FUTrackedList< ObjectClass >::release const ObjectClass *  value  )  [inline]
 

Releases a value contained within a list.

Use this function only if there is no duplicate pointers within the list.

Parameters:
value The value, contained within the list, to release.
Returns:
Whether the value was found and released.

Reimplemented from fm::pvector< ObjectClass >.

template<class ObjectClass = FUTrackable>
virtual bool FUTrackedList< ObjectClass >::TracksObject const FUTrackable object  )  const [inline, virtual]
 

Retrieves whether an object is contained by this container.

Parameters:
object An object.

Reimplemented from FUTracker.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:41 2008 for FCollada by  doxygen 1.4.6-NO