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

clawsoft::AutomatedGC Class Reference

#include <AutomatedGC.h>

Inheritance diagram for clawsoft::AutomatedGC:

Inheritance graph
[legend]
Collaboration diagram for clawsoft::AutomatedGC:

Collaboration graph
[legend]

Detailed Description

This class is a more advanced interface for the garbage colletor, it will automatically check its garbage list to see if some TemporalBuffers has expired.

It will do the checking every _scanperiod milliseconds

STATUS: READY TO TEST


Public Types

enum  SchedPolicy { NORMAL, ROUND_ROBIN, FIFO }

Public Methods

 AutomatedGC (Uint32 speriod)
 This is the default constructor, it will initialize the poll time to speriod milliseconds.

void startChecking ()
 Calls this function to enable the garbage scanning process.

void * run ()
 This is the overriden version of Thread::run PLEASE DONT CALL THIS FUNCTION DIRECTLY.

void stop ()
 This will stop forever the garbage collecting process.

void add (TemporalBuffer *a)
 Add a new memory object to be collected.

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

int start ()
 Call this method when you want to start running your thread.

void killMe ()
 This method detaches the thread from the current running program, just like detach() does.

bool isRunning ()
 Use this method to verify if your thread is running;.

void setSchedulingPolicy (SchedPolicy pol=NORMAL)
 This method will set the scheduling policy for the current thread, there are two types scheduling policies: * Realtime * Non-realtime Realtime policies are the ROUND_ROBIN and FIFO Non-realime is called NORMAL.

void setPriority (int prio)
 Use this method to set the priority for the current scheduling policy.

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


Static Public 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.

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.


Data Fields

bool autodetach
 This variable is just for knowing if the thread can be autodetached or no, currently it does nothing, but is here for backward compatibility.


Protected Methods

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.

int _start ()
 This is a wrapper and is intended to be used only for derived classes.

void detach ()
 This method detaches the thread from the current running program.

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.


Protected Attributes

Uint32 _scanperiod
 The time in milliseconds for polling the garbage list.

bool keepscanning
 This will determine wheter the main garbage scanning loop should continue or not.

List< TemporalBuffer * > * garbage
 This list holds the temporarybuffer objects to be collected when they reach their maximum time to live.


Member Enumeration Documentation

enum clawsoft::Thread::SchedPolicy [inherited]
 

Enumeration values:
NORMAL  Default scheduling policy, non-realtime.
ROUND_ROBIN  Round Robin based realtime scheduling policy.
FIFO  First In First Out based realtime scheduling policy.


Constructor & Destructor Documentation

clawsoft::AutomatedGC::AutomatedGC Uint32    speriod
 

This is the default constructor, it will initialize the poll time to speriod milliseconds.


Member Function Documentation

int clawsoft::Thread::_start   [protected, inherited]
 

This is a wrapper and is intended to be used only for derived classes.

void clawsoft::GarbageCollector::add TemporalBuffer   a [inherited]
 

Add a new memory object to be collected.

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

This will return the CPU speed in megahertz.

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

This will return the CPU speed in megahertz.

void clawsoft::Thread::detach   [protected, inherited]
 

This method detaches the thread from the current running program.

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

Will return the total amount of free system memory.

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.

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

Returns the name of the current class.

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

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

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

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

bool clawsoft::Thread::isRunning   [inline, inherited]
 

Use this method to verify if your thread is running;.

void clawsoft::Thread::killMe   [inherited]
 

This method detaches the thread from the current running program, just like detach() does.

void * clawsoft::AutomatedGC::run   [virtual]
 

This is the overriden version of Thread::run PLEASE DONT CALL THIS FUNCTION DIRECTLY.

Implements clawsoft::Thread.

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.

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.

void clawsoft::Thread::setPriority int    prio [inherited]
 

Use this method to set the priority for the current scheduling policy.

void clawsoft::Thread::setSchedulingPolicy SchedPolicy    pol = NORMAL [inherited]
 

This method will set the scheduling policy for the current thread, there are two types scheduling policies: * Realtime * Non-realtime Realtime policies are the ROUND_ROBIN and FIFO Non-realime is called NORMAL.

int clawsoft::Thread::start   [inherited]
 

Call this method when you want to start running your thread.

void clawsoft::AutomatedGC::startChecking  
 

Calls this function to enable the garbage scanning process.

void clawsoft::AutomatedGC::stop  
 

This will stop forever the garbage collecting process.

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

Will return the total amount of system memory.

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

Will return the total amount of system memory.

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

Will freeze the software for usec microseconds.

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

Will freeze the software for usec microseconds.


Field Documentation

Uint32 clawsoft::AutomatedGC::_scanperiod [protected]
 

The time in milliseconds for polling the garbage list.

bool clawsoft::Thread::autodetach [inherited]
 

This variable is just for knowing if the thread can be autodetached or no, currently it does nothing, but is here for backward compatibility.

List<TemporalBuffer *>* clawsoft::GarbageCollector::garbage [protected, inherited]
 

This list holds the temporarybuffer objects to be collected when they reach their maximum time to live.

bool clawsoft::AutomatedGC::keepscanning [protected]
 

This will determine wheter the main garbage scanning loop should continue or not.


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

Authors:

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

Powered by:

SourceForgeLogo