Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

External::ExternalInterface Class Reference

#include <ExternalInterface.h>

Inheritance diagram for External::ExternalInterface:

Inheritance graph
[legend]
Collaboration diagram for External::ExternalInterface:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ExternalInterface (String *library)
virtual ~ExternalInterface (void)

Protected Member Functions

virtual void * symbol (String *funcName)

Protected Attributes

StringlibName
void * libHandler

Constructor & Destructor Documentation

External::ExternalInterface::ExternalInterface String library  ) 
 

Definition at line 39 of file ExternalInterface.cc.

References Core::String::asCString(), libHandler, and libName.

00040 {
00041     libName = library;
00042     libHandler = dlopen(libName->asCString(), RTLD_NOW);
00043     if (libHandler == NULL) {
00044         (new LibraryNotFoundError(libName, new String(dlerror())))->raise();
00045     }
00046 }

External::ExternalInterface::~ExternalInterface void   )  [virtual]
 

Definition at line 48 of file ExternalInterface.cc.

References libHandler.

00049 {
00050     dlclose(libHandler);
00051 }


Member Function Documentation

void * External::ExternalInterface::symbol String funcName  )  [protected, virtual]
 

Definition at line 54 of file ExternalInterface.cc.

References Core::String::asCString(), and libHandler.

Referenced by External::PluginFactory::newPluginInstance(), and External::PluginFactory::pluginName().

00055 {
00056     void *funcHandler;
00057     const char *errMsg;
00058 
00059     funcHandler = dlsym(libHandler, selector->asCString());
00060     if ((errMsg = dlerror()) != NULL) {
00061         (new ExternalObjectNotFoundError(selector, new String(errMsg)))->raiseFrom(this);
00062     }
00063     return funcHandler;
00064 }


Member Data Documentation

void* External::ExternalInterface::libHandler [protected]
 

Definition at line 41 of file ExternalInterface.h.

Referenced by ExternalInterface(), symbol(), and ~ExternalInterface().

String* External::ExternalInterface::libName [protected]
 

Definition at line 40 of file ExternalInterface.h.

Referenced by ExternalInterface().


The documentation for this class was generated from the following files:
Generated on Mon Nov 27 09:52:10 2006 for Smalltalk like C++ Class Library by  doxygen 1.4.2