#include <SharedVar.h>
Inheritance diagram for clawsoft::SharedVar< T >:
Public Methods | |
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++ (int XXX=0) |
Increases the shared variable's value in one unit. | |
T | operator-- (int XXX=0) |
Decreases the shared variable's value in one unit. | |
Protected Methods | |
void | init () |
Initializer, use in case of not using the default constructor (this interface is provided for future compatibility). | |
void | lock () |
Use this to lock the mutex explicitely. | |
void | unlock () |
Use this to unlock the mutex explicitely. | |
void | setClassName (const char *n) |
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging. | |
const char * | getClassName () |
Returns the name of the current class. | |
Static Protected Methods | |
int | installedCPUs () |
This will return how many CPUs are installed in the system. | |
double | cpuSpeed () |
This will return the CPU speed in megahertz. | |
int | totalMemory () |
Will return the total amount of system memory. | |
int | freeMemory () |
Will return the total amount of free system memory. | |
void | usleep (Uint32 usec) |
Will freeze the software for usec microseconds. | |
Protected Attributes | |
pthread_mutex_t | mutex |
The mutex object itself as defined by POSIX Threads GNU Pth or SDL. | |
Private Attributes | |
T | var |
T var is the shared variable. |
|
Constructor that does nothing.
|
|
This constructor initializes the value of the shared variable.
|
|
This will return the CPU speed in megahertz.
|
|
Will return the total amount of free system memory.
|
|
Returns the name of the current class.
|
|
Returns the values of the shared var.
|
|
Initializer, use in case of not using the default constructor (this interface is provided for future compatibility).
|
|
This will return how many CPUs are installed in the system.
|
|
Use this to lock the mutex explicitely.
|
|
Increases the shared variable's value in one unit.
|
|
Decreases the shared variable's value in one unit.
|
|
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.
|
|
Changes shared valuble's value.
|
|
Will return the total amount of system memory.
|
|
Use this to unlock the mutex explicitely.
|
|
Will freeze the software for usec microseconds.
|
|
The mutex object itself as defined by POSIX Threads GNU Pth or SDL.
|
|
T var is the shared variable.
|
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: