25#include <xplc/IModuleLoader.h>
39# define NAMLEN(dirent) strlen((dirent)->d_name)
42# define NAMLEN(dirent) (dirent)->d_namlen
73 next(aNext), module(aModule) {
82#if defined(SOLARIS) || defined(MACOS)
86IServiceHandler* ModuleManagerFactory::createModuleManager(
const char* directory) {
98 loader = mutate<IModuleLoader>(servmgr->
getObject(XPLC_moduleLoader));
103 dir = opendir(directory);
110 while((ent = readdir(dir))) {
113 snprintf(fname, PATH_MAX,
"%s/%s", directory, ent->d_name);
115 module = loader->loadModule(fname);
143 loader = mutate<IModuleLoader>(servmgr->
getObject(XPLC_moduleLoader));
148 snprintf(pattern,
sizeof(pattern),
"%s/*.*", directory);
150 dir = _findfirst(pattern, &ent);
160 _snprintf(fname,
sizeof(fname),
"%s/%s", directory, ent.name);
162 module = loader->loadModule(fname);
169 }
while(_findnext(dir, &ent) == 0);
179ModuleManager::ModuleManager(
ModuleNode* aModules):
198ModuleManager::~ModuleManager() {
The interface to control the module loader.
The interface that a module should provide.
The basic interface which is included by all other XPLC interfaces and objects.
virtual unsigned int release()=0
Indicate that you are finished using this object.
Interface to an object which can be used to find other objects, given their UUIDs.
virtual IObject * getObject(const UUID &)=0
Get the object corresponding to the given UUID.
The XPLC service manager interface.
virtual IObject * getObject(const UUID &cid)
Get the object corresponding to the given UUID.
The structure underlying UUIDs.
#define UUID_MAP_END
Marks the end of an interface map.
#define UUID_MAP_BEGIN(component)
Start the interface map for "component".
#define UUID_MAP_ENTRY(iface)
Add an entry to an interface map.