#include <SharedVar.h>
Definition at line 26 of file SharedVar.h.
Public Member Functions | |
T | 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. | |
T | operator++ () |
Increases the shared variable's value in one unit. | |
T | operator-- () |
Decreases the shared variable's value in one unit. | |
T | 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 | |
T | var |
T var is the shared variable. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
xvr2::SharedVar< T >::SharedVar | ( | ) | [inline] |
xvr2::SharedVar< T >::SharedVar | ( | T | v | ) | [inline] |
This constructor initializes the value of the shared variable.
Definition at line 48 of file SharedVar.h.
T xvr2::SharedVar< T >::getValue | ( | T | v = 0 |
) | [inline] |
Returns the values of the shared var.
Definition at line 32 of file SharedVar.h.
Referenced by xvr2::Pipeline< _Tp >::operator()().
void xvr2::SharedVar< T >::setValue | ( | T | v = 0 |
) | [inline] |
T xvr2::SharedVar< T >::operator++ | ( | ) | [inline] |
T xvr2::SharedVar< T >::operator-- | ( | ) | [inline] |
T xvr2::SharedVar< T >::operator= | ( | T | v | ) | [inline] |
Definition at line 72 of file SharedVar.h.
bool xvr2::SharedVar< T >::operator== | ( | T | v | ) | [inline] |
Definition at line 78 of file SharedVar.h.
bool xvr2::SharedVar< T >::operator!= | ( | T | 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] |
Use this to explicitely lock the mutex.
Referenced by xvr2::SharedVar< bool >::getValue(), xvr2::Vector< xvr2::PipelineFilter * >::lock(), xvr2::Queue< _Tp >::lock(), xvr2::Map< xvr2::String, xvr2::String, xvr2::Net::URI::_cmpf >::lock(), xvr2::Deque< xvr2::Pipeline::task >::lock(), xvr2::SharedVar< bool >::operator!=(), xvr2::SharedVar< bool >::operator++(), xvr2::SharedVar< bool >::operator--(), xvr2::SharedVar< bool >::operator=(), xvr2::SharedVar< bool >::operator==(), and xvr2::SharedVar< bool >::setValue().
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] |
Use this to explicitely unlock the mutex.
Referenced by xvr2::SharedVar< bool >::getValue(), xvr2::SharedVar< bool >::operator!=(), xvr2::SharedVar< bool >::operator++(), xvr2::SharedVar< bool >::operator--(), xvr2::SharedVar< bool >::operator=(), xvr2::SharedVar< bool >::operator==(), xvr2::SharedVar< bool >::setValue(), xvr2::Vector< xvr2::PipelineFilter * >::unlock(), xvr2::Queue< _Tp >::unlock(), xvr2::Map< xvr2::String, xvr2::String, xvr2::Net::URI::_cmpf >::unlock(), and xvr2::Deque< xvr2::Pipeline::task >::unlock().
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] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
T xvr2::SharedVar< T >::var [private] |
T var is the shared variable.
Definition at line 29 of file SharedVar.h.
Referenced by xvr2::SharedVar< bool >::getValue(), xvr2::SharedVar< bool >::operator!=(), xvr2::SharedVar< bool >::operator++(), xvr2::SharedVar< bool >::operator--(), xvr2::SharedVar< bool >::operator=(), xvr2::SharedVar< bool >::operator==(), xvr2::SharedVar< bool >::setValue(), and xvr2::SharedVar< bool >::SharedVar().
pthread_mutex_t xvr2::Mutex::mutex [inherited] |
pthread_mutexattr_t xvr2::Mutex::m_attr [inherited] |
std::string xvr2::Object::__cls_name [protected, inherited] |