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

Random Class Reference

#include <Random.h>

Inheritance diagram for Random:

Inheritance graph
[legend]
Collaboration diagram for Random:

Collaboration graph
[legend]

Public Methods

 Random ()
 Random (unsigned int seed)
unsigned int random ()
unsigned int random (unsigned int max=RAND_MAX)
unsigned int random (int min, int max)
void autoSeed ()

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 (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.

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


Constructor & Destructor Documentation

Random::Random  
 

Definition at line 7 of file Random.cpp.

References clawsoft.Object.setClassName().

Random::Random unsigned int    seed
 

Definition at line 11 of file Random.cpp.

References clawsoft.Mutex.lock(), clawsoft.Object.setClassName(), and clawsoft.Mutex.unlock().


Member Function Documentation

void Random::autoSeed  
 

Definition at line 34 of file Random.cpp.

References clawsoft.Mutex.lock(), and clawsoft.Mutex.unlock().

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   [inherited]
 

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   [inherited]
 

Use this to lock the mutex explicitely.

Definition at line 59 of file Mutex.cpp.

References clawsoft.Mutex.mutex.

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

unsigned int Random::random int    min,
int    max
 

Definition at line 30 of file Random.cpp.

References random().

unsigned int Random::random unsigned int    max = RAND_MAX
 

Definition at line 18 of file Random.cpp.

References clawsoft.Mutex.lock(), and clawsoft.Mutex.unlock().

unsigned int Random.random  
 

Referenced by clawsoft.provideCard(), and random().

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(), 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   [inherited]
 

Use this to unlock the mutex explicitely.

Definition at line 75 of file Mutex.cpp.

References clawsoft.Mutex.mutex.

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


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

Powered by:

SourceForge Logo