Changeset 7169 in orxonox.OLD for branches/shared_lib/src/util/loading
- Timestamp:
- Feb 19, 2006, 6:35:31 PM (19 years ago)
- Location:
- branches/shared_lib/src/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/shared_lib/src/util/loading/dynamic_loader.cc
r7167 r7169 30 30 */ 31 31 DynamicLoader::DynamicLoader (const std::string& libName) 32 : Factory(NULL, CL_NULL)33 32 { 34 33 this->setClassID(CL_DYNAMIC_LOADER, "DynamicLoader"); … … 62 61 } 63 62 64 bool DynamicLoader::loadDyLib(const std::string&libName)63 bool DynamicLoader::loadDyLib(const char* libName) 65 64 { 66 65 void* handle; 67 handle = dlopen( &libName[0], RTLD_NOW);66 handle = dlopen(libName, RTLD_NOW); 68 67 if(handle == NULL) 69 68 { 70 PRINTF(0)("unable to load %s\n", &libName[0]); 69 PRINTF(1)("unable to load %s: %s\n", libName, dlerror()); 70 71 71 return false; 72 72 } -
branches/shared_lib/src/util/loading/dynamic_loader.h
r7167 r7169 11 11 #include <string> 12 12 13 #define DYNAMIC_LINKAGE_FACTORY(CLASS_NAME, CLASS_ID) \14 void* DynamicCreator(const TiXmlElement* root) { return new CLASS_NAME(root); };15 16 13 // FORWARD DECLARATION 17 14 18 15 //! A class for ... 19 class DynamicLoader : public Factory16 class DynamicLoader : public BaseObject 20 17 { 21 18 … … 27 24 virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const; 28 25 29 static bool loadDyLib(const std::string&libName);26 static bool loadDyLib(const char* libName); 30 27 31 28
Note: See TracChangeset
for help on using the changeset viewer.