xvr2::DSO Class Reference

#include <DSO.h>

Inheritance diagram for xvr2::DSO:

Inheritance graph
[legend]

List of all members.


Detailed Description

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

Definition at line 28 of file DSO.h.


Public Member Functions

 DSO ()
 Default constructor this one does nothing but a few initializations on the handle and loaded variables.
 DSO (const String &plName)
 This constructor initializes on the handle and loaded variables, also it initializes the name of the dso.
 ~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 (const 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.
const StringgetDSOName ()
 This method returns the name of the dso itself.
template<class T>
T * createObject (const String &createfuncname="__xvr2_create_dsobject")
template<class T>
void destroyObject (T *obj, const String &destroyfuncname="__xvr2_destroy_dsobject")
bool isLoaded ()
 Tells whenever the dso file has been loaded or not.
virtual const char * getClassName ()
 Returns the name of the current class.
virtual std::string toString ()

Static Public Member Functions

static void usleep (UInt32 usec)
 This will return how many CPUs are installed in the system.
static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

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.
std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Constructor & Destructor Documentation

xvr2::DSO::DSO (  ) 

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

xvr2::DSO::DSO ( const String plName  ) 

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

xvr2::DSO::~DSO (  ) 


Member Function Documentation

void xvr2::DSO::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 xvr2::DSO::load ( const String plName  ) 

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

void xvr2::DSO::unload (  ) 

Unloads the dso from memory.

void* xvr2::DSO::getSymbol ( const String sym  ) 

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

Referenced by xvr2::DSObjectFactory::create(), createObject(), xvr2::DSObjectFactory::destroy(), and destroyObject().

const String& xvr2::DSO::getDSOName (  ) 

This method returns the name of the dso itself.

template<class T>
T* xvr2::DSO::createObject ( const String createfuncname = "__xvr2_create_dsobject"  )  [inline]

Definition at line 81 of file DSO.h.

References getSymbol().

Here is the call graph for this function:

template<class T>
void xvr2::DSO::destroyObject ( T *  obj,
const String destroyfuncname = "__xvr2_destroy_dsobject" 
) [inline]

Definition at line 89 of file DSO.h.

References getSymbol().

Here is the call graph for this function:

bool xvr2::DSO::isLoaded (  )  [inline]

Tells whenever the dso file has been loaded or not.

Definition at line 98 of file DSO.h.

References loaded.

static void xvr2::System::usleep ( UInt32  usec  )  [static, inherited]

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

This will return the CPU speed in megahertz Will return the total amount of system memory Will return the total amount of free system memory Will freeze the software for usec microseconds

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

virtual std::string xvr2::Object::toString (  )  [virtual, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

String xvr2::DSO::dso [protected]

Holds the filename of the shared object itself.

Definition at line 33 of file DSO.h.

bool xvr2::DSO::loaded [protected]

Tells if the object is loaded or not.

Definition at line 37 of file DSO.h.

Referenced by isLoaded().

void* xvr2::DSO::handle [protected]

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

Definition at line 42 of file DSO.h.

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:53 2008 for X-VR2 SDK by  doxygen 1.5.5