sofa::defaulttype::ExtVector< T > Class Template Reference

Custom vector class. More...

#include <VecTypes.h>

Inheritance diagram for sofa::defaulttype::ExtVector< T >:

Inheritance graph
[legend]
Collaboration diagram for sofa::defaulttype::ExtVector< T >:

Collaboration graph
[legend]

Public Types

typedef T value_type
typedef unsigned int size_type

Public Member Functions

 ExtVector (ExtVectorAllocator< T > *alloc=NULL)
 ExtVector (int size, ExtVectorAllocator< T > *alloc)
 ~ExtVector ()
void setAllocator (ExtVectorAllocator< T > *alloc)
void setData (value_type *d, size_type s)
T * getData ()
const T * getData () const
value_type & operator[] (size_type i)
const value_type & operator[] (size_type i) const
size_type size () const
bool empty () const
void reserve (size_type size)
void resize (size_type size)
void clear ()
void push_back (const T &v)
T * begin ()
const T * begin () const
T * end ()
const T * end () const

Protected Attributes

value_type * data
size_type maxsize
size_type cursize
ExtVectorAllocator< T > * allocator

Friends

std::ostream & operator<< (std::ostream &os, const ExtVector< T > &vec)
 Output stream.
std::istream & operator>> (std::istream &in, ExtVector< T > &vec)
 Input stream.

Detailed Description

template<class T>
class sofa::defaulttype::ExtVector< T >

Custom vector class.

This class allows custom buffer allocation while not having any virtual methods using a bridge pattern with ExtVectorAllocator

Definition at line 141 of file VecTypes.h.


Member Typedef Documentation

template<class T >
typedef unsigned int sofa::defaulttype::ExtVector< T >::size_type

template<class T >
typedef T sofa::defaulttype::ExtVector< T >::value_type


Constructor & Destructor Documentation

template<class T >
sofa::defaulttype::ExtVector< T >::ExtVector ( ExtVectorAllocator< T > *  alloc = NULL  )  [inline, explicit]

Definition at line 153 of file VecTypes.h.

template<class T >
sofa::defaulttype::ExtVector< T >::ExtVector ( int  size,
ExtVectorAllocator< T > *  alloc 
) [inline]

Definition at line 154 of file VecTypes.h.

template<class T >
sofa::defaulttype::ExtVector< T >::~ExtVector (  )  [inline]

Definition at line 155 of file VecTypes.h.


Member Function Documentation

template<class T >
const T* sofa::defaulttype::ExtVector< T >::begin (  )  const [inline]

Definition at line 218 of file VecTypes.h.

template<class T >
T* sofa::defaulttype::ExtVector< T >::begin (  )  [inline]

Definition at line 217 of file VecTypes.h.

Referenced by sofa::component::collision::DistanceGrid::calcDistance().

template<class T >
void sofa::defaulttype::ExtVector< T >::clear (  )  [inline]

Definition at line 207 of file VecTypes.h.

template<class T >
bool sofa::defaulttype::ExtVector< T >::empty (  )  const [inline]

template<class T >
const T* sofa::defaulttype::ExtVector< T >::end (  )  const [inline]

Definition at line 220 of file VecTypes.h.

template<class T >
T* sofa::defaulttype::ExtVector< T >::end (  )  [inline]

Definition at line 219 of file VecTypes.h.

Referenced by sofa::component::collision::DistanceGrid::calcDistance().

template<class T >
const T* sofa::defaulttype::ExtVector< T >::getData (  )  const [inline]

Definition at line 177 of file VecTypes.h.

template<class T >
T* sofa::defaulttype::ExtVector< T >::getData (  )  [inline]

template<class T >
const value_type& sofa::defaulttype::ExtVector< T >::operator[] ( size_type  i  )  const [inline]

Definition at line 180 of file VecTypes.h.

template<class T >
value_type& sofa::defaulttype::ExtVector< T >::operator[] ( size_type  i  )  [inline]

Definition at line 179 of file VecTypes.h.

template<class T >
void sofa::defaulttype::ExtVector< T >::push_back ( const T &  v  )  [inline]

Definition at line 211 of file VecTypes.h.

template<class T >
void sofa::defaulttype::ExtVector< T >::reserve ( size_type  size  )  [inline]

Definition at line 183 of file VecTypes.h.

template<class T >
void sofa::defaulttype::ExtVector< T >::resize ( size_type  size  )  [inline]

template<class T >
void sofa::defaulttype::ExtVector< T >::setAllocator ( ExtVectorAllocator< T > *  alloc  )  [inline]

Definition at line 156 of file VecTypes.h.

template<class T >
void sofa::defaulttype::ExtVector< T >::setData ( value_type *  d,
size_type  s 
) [inline]

Definition at line 175 of file VecTypes.h.

template<class T >
size_type sofa::defaulttype::ExtVector< T >::size ( void   )  const [inline]


Friends And Related Function Documentation

template<class T >
std::ostream& operator<< ( std::ostream &  os,
const ExtVector< T > &  vec 
) [friend]

Output stream.

Definition at line 224 of file VecTypes.h.

template<class T >
std::istream& operator>> ( std::istream &  in,
ExtVector< T > &  vec 
) [friend]

Input stream.

Definition at line 234 of file VecTypes.h.


Field Documentation

template<class T >
ExtVectorAllocator<T>* sofa::defaulttype::ExtVector< T >::allocator [protected]

template<class T >
size_type sofa::defaulttype::ExtVector< T >::cursize [protected]

template<class T >
value_type* sofa::defaulttype::ExtVector< T >::data [protected]

template<class T >
size_type sofa::defaulttype::ExtVector< T >::maxsize [protected]


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

Generated on Sun Nov 23 04:23:56 2008 for Sofa by  doxygen 1.5.7.1