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

clawsoft::Plugin Class Reference

#include <Plugin.h>

Inheritance diagram for clawsoft::Plugin:

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

Collaboration graph
[legend]

Detailed Description

This is the plugin class, it adds an interface for loading dynamic shared objects to your program.


Public Methods

 Plugin ()
 Default constructor this one does nothing but a few initializations on the handle and loaded variables.

 Plugin (const String &plName)
 This constructor initializes on the handle and loaded variables, also it initializes the name of the dso.

void load ()
 Loads the dso into memory, this method requires the use of the second constructor, not the default one if you've used the default then you shold probably use the another load method.

void load (String plName)
 Loads the dso defined by plName and updates the contents of the dso variable name.

void unload ()
 Unloads the dso from memory.

void * getSymbol (const String &sym)
 Use this method whenever you want to obtain a symbol from the dso.

String & getDSOName ()
 This method returns the name of the dso itself.

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.


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.


Protected Attributes

String dso
 Holds the filename of the shared object itself.

bool loaded
 Tells if the object is loaded or not.

void * handle
 This is the handle value as returned by the dlopen function.


Constructor & Destructor Documentation

clawsoft::Plugin::Plugin (    ) 
 

Default constructor this one does nothing but a few initializations on the handle and loaded variables.

clawsoft::Plugin::Plugin (  const String &    plName ) 
 

This constructor initializes on the handle and loaded variables, also it initializes the name of the dso.


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.

String& clawsoft::Plugin::getDSOName (    ) 
 

This method returns the name of the dso itself.

void * clawsoft::Plugin::getSymbol (  const String &    sym ) 
 

Use this method whenever you want to obtain a symbol from the dso.

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

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

void clawsoft::Plugin::load (  String    plName ) 
 

Loads the dso defined by plName and updates the contents of the dso variable name.

void clawsoft::Plugin::load (    ) 
 

Loads the dso into memory, this method requires the use of the second constructor, not the default one if you've used the default then you shold probably use the another load method.

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.

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

Will return the total amount of system memory.

void clawsoft::Plugin::unload (    ) 
 

Unloads the dso from memory.

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

Will freeze the software for usec microseconds.


Field Documentation

String clawsoft::Plugin::dso [protected]
 

Holds the filename of the shared object itself.

void* clawsoft::Plugin::handle [protected]
 

This is the handle value as returned by the dlopen function.

bool clawsoft::Plugin::loaded [protected]
 

Tells if the object is loaded 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