fm::pvector< T > Class Template Reference
[Mathematics Classes.]

A dynamically-sized array of pointers. More...

#include <FMArrayPointer.h>

Inheritance diagram for fm::pvector< T >:

fm::vector< const void *, true > List of all members.

Public Types

typedef fm::vector< const
void *, true > 
Parent
 Defines the parent class to the pointer array.
typedef T * item
 Defines the item pointer type contained by the pointer array.
typedef const T * 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

 pvector ()
 Default constructor.
 pvector (size_t size)
 Constructor.
 pvector (size_t size, const T &defaultValue)
 Constructor.
 pvector (const pvector< T > &copy)
 Copy constructor.
 pvector (const T **values, size_t count)
 Constructor.
 ~pvector ()
 Destructor.
T *& front ()
 Retrieves the first element of the pointer array.
const T *& front () const
 See above.
T *& back ()
 Retrieves the last element of the pointer array.
const T *& back () const
 See above.
T *& at (size_t index)
 Retrieves an indexed object in the pointer array.
const T *& at (size_t index) const
 See above.
template<class INTEGER>
T *& operator[] (INTEGER index)
 See above.
template<class INTEGER>
const T *& operator[] (INTEGER index) const
 See above.
iterator begin ()
 Retrieves an iterator for the first element in the pointer array.
const_iterator begin () const
 See above.
iterator end ()
 Retrieves an iterator for the element after the last element in the pointer array.
const_iterator end () const
 See above.
iterator find (const T *item)
 Retrieves an iterator for a given element in the pointer array.
const_iterator find (const T *item) const
 See above.
iterator insert (iterator _iterator, T *object)
 Inserts an object in the container's containment pointer array.
void insert (iterator _iterator, size_t count)
 Adds a given number of NULL pointers at a given position in the pointer array.
template<class _It>
void insert (iterator _where, _It _startIterator, _It _endIterator)
 Inserts a list of pointers in the pointer array.
iterator erase (iterator _it)
 Removes the value at the given position within the pointer array.
bool erase (const T *value)
 Removes a given pointer from the pointer array.
void erase (iterator first, iterator last)
 Removes the value at the given position within the pointer array.
void erase (size_t index)
 Removes an indexed value contained within the list.
bool release (const T *value)
 Releases a value contained within a list.
pvector< T > & operator= (const pvector< T > &other)
 Copy constructor.
void resize (size_t count)
 Resizes the pointer array to the given amount.

Detailed Description

template<class T>
class fm::pvector< T >

A dynamically-sized array of pointers.

Built on top of the FCollada specialized vector class, this class improves on the compilation time and the library size by re-using the <void*> template only once for all pointer vectors.


Constructor & Destructor Documentation

template<class T>
fm::pvector< T >::pvector size_t  size  )  [inline]
 

Constructor.

Builds a dynamically-sized pointer array of the desired size.

Parameters:
size The desired size of the array.

template<class T>
fm::pvector< T >::pvector size_t  size,
const T &  defaultValue
[inline]
 

Constructor.

Builds a dynamically-sized pointer array of the desired size.

Parameters:
size The desired size of the pointer array
defaultValue The default value to use for all the pointers of the array.

template<class T>
fm::pvector< T >::pvector const pvector< T > &  copy  )  [inline]
 

Copy constructor.

Parameters:
copy The dynamically-sized pointer array to copy the values from.

template<class T>
fm::pvector< T >::pvector const T **  values,
size_t  count
[inline]
 

Constructor.

Builds a dynamically-sized pointer array from a constant-sized array.

Parameters:
values A constant-sized array of floating-point values.
count The size of the constant-sized array.


Member Function Documentation

template<class T>
T*& fm::pvector< T >::at size_t  index  )  [inline]
 

Retrieves an indexed object in the pointer array.

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

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

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
T*& fm::pvector< T >::back  )  [inline]
 

Retrieves the last element of the pointer array.

Returns:
The last element in the pointer array.

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

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
iterator fm::pvector< T >::begin  )  [inline]
 

Retrieves an iterator for the first element in the pointer array.

Returns:
an iterator for the first element in the pointer array.

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

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
iterator fm::pvector< T >::end  )  [inline]
 

Retrieves an iterator for the element after the last element in the pointer array.

Returns:
an iterator for the element after the last element in the pointer array.

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

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
void fm::pvector< T >::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::vector< const void *, true >.

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
void fm::pvector< T >::erase iterator  first,
iterator  last
[inline]
 

Removes the value at the given position within the pointer array.

Parameters:
first The start position for the pointers to remove.
last The end position for the pointers to remove.

Reimplemented in FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
bool fm::pvector< T >::erase const T *  value  )  [inline]
 

Removes a given pointer from the pointer array.

Parameters:
value The pointer to remove from the pointer array.
Returns:
Whether the given pointer existed within the pointer array.

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
iterator fm::pvector< T >::erase iterator  _it  )  [inline]
 

Removes the value at the given position within the pointer array.

Parameters:
_it The position for the pointer to remove.

Reimplemented in FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
iterator fm::pvector< T >::find const T *  item  )  [inline]
 

Retrieves an iterator for a given element in the pointer array.

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

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
T*& fm::pvector< T >::front  )  [inline]
 

Retrieves the first element of the pointer array.

Returns:
The first element in the pointer array.

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

Reimplemented in FUObjectContainer< ObjectClass >, FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
template<class _It>
void fm::pvector< T >::insert iterator  _where,
_It  _startIterator,
_It  _endIterator
[inline]
 

Inserts a list of pointers in the pointer array.

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

Reimplemented in FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
void fm::pvector< T >::insert iterator  _iterator,
size_t  count
[inline]
 

Adds a given number of NULL pointers at a given position in the pointer array.

Parameters:
_iterator The iterator after which to insert the object.
count The number of NULL pointers to add.

template<class T>
iterator fm::pvector< T >::insert iterator  _iterator,
T *  object
[inline]
 

Inserts an object in the container's containment pointer array.

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

Reimplemented in FUTrackedList< ObjectClass >, FUObjectContainer< FUPlugin >, FUObjectContainer< FCDAnimated >, FUObjectContainer< FCDPlaceHolder >, and FUTrackedList< FCDEntityReference >.

template<class T>
pvector<T>& fm::pvector< T >::operator= const pvector< T > &  other  )  [inline]
 

Copy constructor.

Overwrites the current data of the pointer array with the data of the given pointer array.

Parameters:
other The pointer array to copy.
Returns:
The copied pointer array.

template<class T>
bool fm::pvector< T >::release const T *  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 in FUTrackedList< ObjectClass >, and FUTrackedList< FCDEntityReference >.

template<class T>
void fm::pvector< T >::resize size_t  count  )  [inline]
 

Resizes the pointer array to the given amount.

It is intentional that the default value is NULL.

Parameters:
count The desired size for the pointer array.

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


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