ModuleManager Class Reference

manages the loading of Qore modules from feature or path names. Also manages adding module changes into QoreProgram objects. More...

#include <ModuleManager.h>

List of all members.

Public Member Functions

DLLLOCAL ModuleManager ()
 creates the ModuleManager object (private)

Static Public Member Functions

static DLLEXPORT void addModuleDir (const char *dir)
 to add a single directory to the QORE_MODULE_DIR list, can only be called before the library initialization function qore_init()
static DLLEXPORT void addAutoModuleDir (const char *dir)
 to add a single directory to the QORE_AUTO_MODULE_DIR list, can only be called before the library initialization function qore_init()
static DLLEXPORT void addModuleDirList (const char *strlist)
 to add a list of directories separated by ':' characters to the QORE_MODULE_DIR list, can only be called before the library initialization function qore_init()
static DLLEXPORT void addAutoModuleDirList (const char *strlist)
 to add a list of directories separated by ':' characters to the QORE_AUTO_MODULE_DIR list, can only be called before the library initialization function qore_init()
static DLLEXPORT QoreListNodegetModuleList ()
 retuns a list of module information hashes, caller owns the list reference returned
static DLLEXPORT int runTimeLoadModule (const char *name, ExceptionSink *xsink)
 loads the named module at run time, returns -1 if an exception was raised, 0 for OK
static DLLEXPORT QoreStringNodeparseLoadModule (const char *name, QoreProgram *pgm=0)
 loads the named module at parse time (or before run time, even if parsing is not active), returns a non-0 QoreStringNode pointer if an error occured, caller owns the QoreStringNode pointer's reference count returned if non-0
static DLLLOCAL void init (bool se)
 explicit initialization and autoloading (private)
static DLLLOCAL void cleanup ()
 explicit cleanup (private)

Detailed Description

manages the loading of Qore modules from feature or path names. Also manages adding module changes into QoreProgram objects.

in the case that a QoreProgram object is created before a module is loaded externally (either through another QoreProgram object or through a direct call to the appropriate ModuleManager function), if the QoreProgram object then requests the feature, the ModuleManager will load in all namespace (class, constant, etc) changes into the QoreProgram object. All members and methods are static; there will always only be one of these...


Constructor & Destructor Documentation

DLLLOCAL ModuleManager::ModuleManager (  ) 

creates the ModuleManager object (private)

private interface; not exported in the library's public API


Member Function Documentation

static DLLEXPORT void ModuleManager::addAutoModuleDir ( const char *  dir  )  [static]

to add a single directory to the QORE_AUTO_MODULE_DIR list, can only be called before the library initialization function qore_init()

Parameters:
dir the directory path to add to the list
static DLLEXPORT void ModuleManager::addAutoModuleDirList ( const char *  strlist  )  [static]

to add a list of directories separated by ':' characters to the QORE_AUTO_MODULE_DIR list, can only be called before the library initialization function qore_init()

Parameters:
strlist a list of directories separated by ':' characters to add to the QORE_AUTO_MODULE_DIR list
static DLLEXPORT void ModuleManager::addModuleDir ( const char *  dir  )  [static]

to add a single directory to the QORE_MODULE_DIR list, can only be called before the library initialization function qore_init()

Parameters:
dir the directory path to add to the list
static DLLEXPORT void ModuleManager::addModuleDirList ( const char *  strlist  )  [static]

to add a list of directories separated by ':' characters to the QORE_MODULE_DIR list, can only be called before the library initialization function qore_init()

Parameters:
strlist a list of directories separated by ':' characters to add to the QORE_MODULE_DIR list
static DLLLOCAL void ModuleManager::cleanup (  )  [static]

explicit cleanup (private)

private interface; not exported in the library's public API

static DLLLOCAL void ModuleManager::init ( bool  se  )  [static]

explicit initialization and autoloading (private)

private interface; not exported in the library's public API

static DLLEXPORT QoreStringNode* ModuleManager::parseLoadModule ( const char *  name,
QoreProgram pgm = 0 
) [static]

loads the named module at parse time (or before run time, even if parsing is not active), returns a non-0 QoreStringNode pointer if an error occured, caller owns the QoreStringNode pointer's reference count returned if non-0

if the feature is already loaded, then the function returns immediately without raising an error The feature's namespace changes are added to the QoreProgram object if the feature is loaded and the pgm argument is non-zero.

Parameters:
name can be either a feature name or the full path to the module file
pgm the QoreProgram object in which to include all module additions (namespaces, classes, constants, etc) immediately
static DLLEXPORT int ModuleManager::runTimeLoadModule ( const char *  name,
ExceptionSink xsink 
) [static]

loads the named module at run time, returns -1 if an exception was raised, 0 for OK

If the feature is already loaded, then the function returns immediately without raising an error. The feature's namespace changes are added to the QoreProgram object if the feature is loaded.

Parameters:
name can be either a feature name or the full path to the module file
xsink if any errors are encountered loading the module, then a Qore-language "LOAD-MODULE-ERROR" exception is raised here
Returns:
-1 if an exception was raised, 0 for OK

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

Generated on 14 Jun 2010 for Qore Programming Language by  doxygen 1.6.1