Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

clawsoft::SharedVar< T > Class Template Reference

#include <SharedVar.h>

Inheritance diagram for clawsoft::SharedVar< T >:

Inheritance graph
[legend]
Collaboration diagram for clawsoft::SharedVar< T >:

Collaboration graph
[legend]

Detailed Description

template<class T>
class clawsoft::SharedVar< T >

This class is define template to implemented Shared varibles.


Public Methods

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++ (int XXX=0)
 Increases the shared variable's value in one unit.

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

var
 T var is the shared variable.


Constructor & Destructor Documentation

template<class T>
clawsoft::SharedVar< T >::SharedVar   [inline]
 

Constructor that does nothing.

template<class T>
clawsoft::SharedVar< T >::SharedVar   v [inline]
 

This constructor initializes the value of the shared variable.


Member Function Documentation

double clawsoft::System::cpuSpeed   [static, inherited]
 

This will return the CPU speed in megahertz.

int clawsoft::System::freeMemory   [static, inherited]
 

Will return the total amount of free system memory.

const char * clawsoft::Object::getClassName   [inherited]
 

Returns the name of the current class.

template<class T>
T clawsoft::SharedVar< T >::getValue   v = 0 [inline]
 

Returns the values of the shared var.

void clawsoft::Mutex::init   [inherited]
 

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

int clawsoft::System::installedCPUs   [static, inherited]
 

This will return how many CPUs are installed in the system.

void clawsoft::Mutex::lock   [inherited]
 

Use this to lock the mutex explicitely.

template<class T>
T clawsoft::SharedVar< T >::operator++ int    XXX = 0 [inline]
 

Increases the shared variable's value in one unit.

template<class T>
T clawsoft::SharedVar< T >::operator-- int    XXX = 0 [inline]
 

Decreases the shared variable's value in one unit.

void clawsoft::Object::setClassName const char *    n [protected, inherited]
 

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.

template<class T>
void clawsoft::SharedVar< T >::setValue   v = 0 [inline]
 

Changes shared valuble's value.

int clawsoft::System::totalMemory   [static, inherited]
 

Will return the total amount of system memory.

void clawsoft::Mutex::unlock   [inherited]
 

Use this to unlock the mutex explicitely.

void clawsoft::System::usleep Uint32    usec [static, inherited]
 

Will freeze the software for usec microseconds.


Field Documentation

pthread_mutex_t clawsoft::Mutex::mutex [inherited]
 

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

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

T var is the shared variable.


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

Authors:

Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara

Powered by:

SourceForgeLogo