xvr2::Vector< _Tp, _Alloc > Class Template Reference

#include <Vector.h>

Inheritance diagram for xvr2::Vector< _Tp, _Alloc >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
class xvr2::Vector< _Tp, _Alloc >

Same as std::vector, but including some exclusive features from X-VR2.

You may use this class in the same way you use std::vector, in fact you don't need to use it at all, but bear in mind something, the standard std::vector class does not include some methods added here like Vector::toString() or Vector::lock() and Vector::unlock()

Todo:
Document xvr2::Vector classes.

Definition at line 30 of file Vector.h.


Public Member Functions

template<typename _InputIterator>
 Vector (_InputIterator __first, _InputIterator __last, const _Alloc &__a=_Alloc())
 Builds a Vector from a range.
 Vector (const Vector &__x)
 Copy constructor, builds a vector from another.
 Vector (size_t __n, const _Tp &__value=_Tp(), const _Alloc &__a=_Alloc())
 Instantites a fixed size vector.
 Vector (const _Alloc &__a=_Alloc())
 Instantiates a Vector object with the given allocator.
std::string toString ()
 Converts the items list to an understadable array.
void lock ()
 Restricts access from another thread to whatever operations you're doing here look at: xvr2::Mutex::lock().
void unlock ()
 Reenables access to other threads, this is the exact opposite of Vector::lock.
virtual const char * getClassName ()
 Returns the name of the current class.

Static Public Member Functions

static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Attributes

Mutex mv
std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Constructor & Destructor Documentation

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
template<typename _InputIterator>
xvr2::Vector< _Tp, _Alloc >::Vector ( _InputIterator  __first,
_InputIterator  __last,
const _Alloc &  __a = _Alloc() 
) [inline]

Builds a Vector from a range.

Definition at line 36 of file Vector.h.

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
xvr2::Vector< _Tp, _Alloc >::Vector ( const Vector< _Tp, _Alloc > &  __x  )  [inline]

Copy constructor, builds a vector from another.

Definition at line 41 of file Vector.h.

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
xvr2::Vector< _Tp, _Alloc >::Vector ( size_t  __n,
const _Tp &  __value = _Tp(),
const _Alloc &  __a = _Alloc() 
) [inline]

Instantites a fixed size vector.

Definition at line 43 of file Vector.h.

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
xvr2::Vector< _Tp, _Alloc >::Vector ( const _Alloc &  __a = _Alloc()  )  [inline]

Instantiates a Vector object with the given allocator.

Definition at line 48 of file Vector.h.


Member Function Documentation

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
std::string xvr2::Vector< _Tp, _Alloc >::toString (  )  [inline, virtual]

Converts the items list to an understadable array.

Reimplemented from xvr2::Object.

Definition at line 52 of file Vector.h.

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
void xvr2::Vector< _Tp, _Alloc >::lock (  )  [inline]

Restricts access from another thread to whatever operations you're doing here look at: xvr2::Mutex::lock().

If for some reason you need to share this Vector between multiple threads you should make use of the provided locking mechanism to serialize read/write access. That being said you should call lock() first, then perform whatever you need to do with the Vector and finally call unlock().

Definition at line 73 of file Vector.h.

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
void xvr2::Vector< _Tp, _Alloc >::unlock (  )  [inline]

Reenables access to other threads, this is the exact opposite of Vector::lock.

See also:
Vector::lock

Definition at line 79 of file Vector.h.

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
Mutex xvr2::Vector< _Tp, _Alloc >::mv [protected]

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:59 2008 for X-VR2 SDK by  doxygen 1.5.5