#include <mcllib/MCLibrary.h>
Inheritance diagram for MCLibrary:
Public Member Functions | |
MCLibrarySym | find (const MCString &symbol, bool isFunction) |
Find a symbol in the library. | |
const MCString & | getName () const |
Get the library name as used at construction. | |
MCLibrary (const MCString &libName) | |
Construct from a dynamic library file. | |
MCLibrary () | |
Default constructor. |
Symbols within the library can be accessed using the find() method. When a library is loaded the MCLibMain() function is called (if it exists in the library) with the parameter true, to indicate that the library is being loaded. When the library is unloaded (at destruction time), the MCLibMain() function is called with the parameter false to indicate that the library is being unloaded.
Example
MCL_EXPORT void MCLibMain(bool load) { if (!load) return; // make sure that events used by the library exist MCEvent::registerEvent("myEvent.mydomain.com"); }
|
Default constructor. Attempts to use find() on a library object created using the default constructor will cause an exception to be thrown. |
|
Construct from a dynamic library file.
|
|
Find a symbol in the library. If the symbol does not exist in the library an exception will be thrown. On systems which distinguish between function and non-function symbols, the application must set isFunction to true to load function symbols and false to load non-function symbols, otherwise the corresponding symbol cannot be loaded. On other systems (in particular, unix and windows) symbols can be loaded whether or not isFunction matches the type of symbol. On all systems, isFunction determines the result of calls to the isFunction() method on the returned MCLibrarySym.
|
|
Get the library name as used at construction.
|