xvr2::SharedVar< T > Class Template Reference

#include <SharedVar.h>

Inheritance diagram for xvr2::SharedVar< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T>
class xvr2::SharedVar< T >

This class is define template to implemented Shared varibles.

Todo:
Polish the SharedVar class docs.

Definition at line 26 of file SharedVar.h.


Public Member Functions

getValue (T v=0)
 Returns the values of the shared var.
void setValue (T v=0)
 Changes shared valuble's value.
 SharedVar ()
 Constructor that does nothing.
 SharedVar (T v)
 This constructor initializes the value of the shared variable.
operator++ ()
 Increases the shared variable's value in one unit.
operator-- ()
 Decreases the shared variable's value in one unit.
operator= (T v)
bool operator== (T v)
bool operator!= (T v)

Protected Member Functions

void init ()
 Initializer, use in case of not using the default constructor (this interface is provided for future compatibility).
void lock ()
 Use this to explicitely lock the mutex.
void trylock ()
 Use this attemp a lock on the thread, if the mutex has already been locked, then it will throw a corresponding exception.
void unlock ()
 Use this to explicitely unlock the mutex.
virtual const char * getClassName ()
 Returns the name of the current class.
virtual std::string toString ()

Static Protected 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

pthread_mutex_t mutex
 The mutex object itself as defined by POSIX Threads GNU Pth or SDL.
pthread_mutexattr_t m_attr
std::string __cls_name

Private Attributes

var
 T var is the shared variable.

Friends

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

Constructor & Destructor Documentation

template<class T>
xvr2::SharedVar< T >::SharedVar (  )  [inline]

Constructor that does nothing.

Definition at line 45 of file SharedVar.h.

template<class T>
xvr2::SharedVar< T >::SharedVar ( v  )  [inline]

This constructor initializes the value of the shared variable.

Definition at line 48 of file SharedVar.h.


Member Function Documentation

template<class T>
T xvr2::SharedVar< T >::getValue ( v = 0  )  [inline]

Returns the values of the shared var.

Definition at line 32 of file SharedVar.h.

Referenced by xvr2::Pipeline< _Tp >::operator()().

template<class T>
void xvr2::SharedVar< T >::setValue ( v = 0  )  [inline]

Changes shared valuble's value.

Definition at line 39 of file SharedVar.h.

template<class T>
T xvr2::SharedVar< T >::operator++ (  )  [inline]

Increases the shared variable's value in one unit.

Definition at line 53 of file SharedVar.h.

template<class T>
T xvr2::SharedVar< T >::operator-- (  )  [inline]

Decreases the shared variable's value in one unit.

Definition at line 63 of file SharedVar.h.

template<class T>
T xvr2::SharedVar< T >::operator= ( v  )  [inline]

Definition at line 72 of file SharedVar.h.

template<class T>
bool xvr2::SharedVar< T >::operator== ( v  )  [inline]

Definition at line 78 of file SharedVar.h.

template<class T>
bool xvr2::SharedVar< T >::operator!= ( v  )  [inline]

Definition at line 85 of file SharedVar.h.

void xvr2::Mutex::init (  )  [inherited]

Initializer, use in case of not using the default constructor (this interface is provided for future compatibility).

void xvr2::Mutex::lock (  )  [inherited]

void xvr2::Mutex::trylock (  )  [inherited]

Use this attemp a lock on the thread, if the mutex has already been locked, then it will throw a corresponding exception.

void xvr2::Mutex::unlock (  )  [inherited]

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]

virtual std::string xvr2::Object::toString (  )  [virtual, inherited]


Friends And Related Function Documentation

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


Member Data Documentation

template<class T>
T xvr2::SharedVar< T >::var [private]

pthread_mutex_t xvr2::Mutex::mutex [inherited]

The mutex object itself as defined by POSIX Threads GNU Pth or SDL.

Definition at line 48 of file Mutex.h.

pthread_mutexattr_t xvr2::Mutex::m_attr [inherited]

Definition at line 49 of file Mutex.h.

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:56 2008 for X-VR2 SDK by  doxygen 1.5.5