Main Page   Packages   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals  

clawsoft.Mutex Class Reference

#include <Mutex.h>

Inheritance diagram for clawsoft.Mutex:

Inheritance graph
[legend]
Collaboration diagram for clawsoft.Mutex:

Collaboration graph
[legend]

Detailed Description

This class defines an interface to MUTual EXclusion locks.

Definition at line 52 of file Mutex.h.

Public Methods

 Mutex (int autoinit=1)
 Constructor initialize using default atttributes, this depends on how you compiled the library if you chose GNU Pth then the first argument is meaningfull.

 ~Mutex ()
 This destructor calls dastroy to ensure that all the resources used by the Mutex all released automagically.

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.

char * getClassName ()
 Returns the name of the current class.


Protected Methods

void setClassName (char *n)
 Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process.


Private Methods

void destroy ()
 Destroys the current mutex, freeing all the resources allocated by it.


Private Attributes

SDL_mutex * mutex
 The mutex object itself as define by POSIX Threads or GNU Pth.


Constructor & Destructor Documentation

clawsoft.Mutex::Mutex int    autoinit = 1
 

Constructor initialize using default atttributes, this depends on how you compiled the library if you chose GNU Pth then the first argument is meaningfull.

Definition at line 44 of file Mutex.cpp.

References clawsoft.Mutex.init(), and clawsoft.Object.setClassName().

clawsoft.Mutex.~Mutex   [inline]
 

This destructor calls dastroy to ensure that all the resources used by the Mutex all released automagically.

Definition at line 76 of file Mutex.h.

References clawsoft.Mutex.destroy().


Member Function Documentation

void clawsoft.Mutex::destroy   [private]
 

Destroys the current mutex, freeing all the resources allocated by it.

Definition at line 90 of file Mutex.cpp.

References clawsoft.Mutex.mutex.

Referenced by clawsoft.Mutex.~Mutex().

char * clawsoft.Object::getClassName   [inherited]
 

Returns the name of the current class.

Definition at line 18 of file Object.cpp.

References clawsoft.Object.__cls_name.

void clawsoft.Mutex::init  
 

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

Definition at line 54 of file Mutex.cpp.

References clawsoft.Mutex.mutex.

Referenced by clawsoft.Mutex.Mutex().

void clawsoft.Mutex::lock  
 

Use this to lock the mutex explicitely.

Definition at line 59 of file Mutex.cpp.

References clawsoft.Mutex.mutex.

Referenced by Random.autoSeed(), clawsoft.SharedVar< int >.getValue(), clawsoft.KeyboardEvent.keyPressed(), clawsoft.SharedVar< int >.operator++(), clawsoft.SharedVar< int >.operator--(), Random.random(), Random.Random(), and clawsoft.SharedVar< int >.setValue().

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

Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process.

Definition at line 14 of file Object.cpp.

References clawsoft.Object.__cls_name.

Referenced by clawsoft.ArrayOutOfBoundsException.ArrayOutOfBoundsException(), clawsoft.BrokenPipeException.BrokenPipeException(), clawsoft.Dialog.CancelButton.CancelButton(), clawsoft.CantLoadDSOException.CantLoadDSOException(), clawsoft.CantUnloadDSOException.CantUnloadDSOException(), clawsoft.ConnectionRefusedException.ConnectionRefusedException(), clawsoft.ConnectionTimeoutException.ConnectionTimeoutException(), clawsoft.Dialog.Dialog(), clawsoft.DSOException.DSOException(), clawsoft.DSOSymbolException.DSOSymbolException(), clawsoft.ElementNotFoundException.ElementNotFoundException(), clawsoft.Font.Font(), clawsoft.GameSelector.GameSelector(), clawsoft.Dialog.HelpButton.HelpButton(), clawsoft.IOException.IOException(), clawsoft.KeyboardEvent.KeyboardEvent(), clawsoft.LoginDialog.LoginDialog(), clawsoft.Mutex.Mutex(), clawsoft.MutexException.MutexException(), clawsoft.NetworkException.NetworkException(), clawsoft.NetworkUnreachableException.NetworkUnreachableException(), clawsoft.NoMoreTokensException.NoMoreTokensException(), clawsoft.NullPointerException.NullPointerException(), clawsoft.NumberException.NumberException(), clawsoft.Object.Object(), clawsoft.Dialog.OKButton.OKButton(), clawsoft.Plugin.Plugin(), clawsoft.ProcOutOfFileDescriptorsException.ProcOutOfFileDescriptorsException(), Random.Random(), clawsoft.ServerSocket.ServerSocket(), clawsoft.Socket.Socket(), clawsoft.SocketAlreadyBoundedException.SocketAlreadyBoundedException(), clawsoft.SocketAlreadyUsedException.SocketAlreadyUsedException(), clawsoft.SocketUnableToReadException.SocketUnableToReadException(), clawsoft.SocketUnableToWriteException.SocketUnableToWriteException(), clawsoft.SysOutOfFileDescriptorsException.SysOutOfFileDescriptorsException(), clawsoft.TextBox.TextBox(), clawsoft.TextButton.TextButton(), clawsoft.TextField.TextField(), clawsoft.Thread.Thread(), clawsoft.UnableToLockMutexException.UnableToLockMutexException(), clawsoft.UnableToUnlockMutexException.UnableToUnlockMutexException(), and clawsoft.Window.Window().

void clawsoft.Mutex::unlock  
 

Use this to unlock the mutex explicitely.

Definition at line 75 of file Mutex.cpp.

References clawsoft.Mutex.mutex.

Referenced by Random.autoSeed(), clawsoft.SharedVar< int >.getValue(), clawsoft.KeyboardEvent.keyPressed(), clawsoft.SharedVar< int >.operator++(), clawsoft.SharedVar< int >.operator--(), Random.random(), Random.Random(), and clawsoft.SharedVar< int >.setValue().


Field Documentation

SDL_mutex* clawsoft.Mutex.mutex [private]
 

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

Definition at line 58 of file Mutex.h.

Referenced by clawsoft.Mutex.destroy(), clawsoft.Mutex.init(), clawsoft.Mutex.lock(), and clawsoft.Mutex.unlock().


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

Powered by:

SourceForge Logo