Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7169 in orxonox.OLD for branches/shared_lib/src/util


Ignore:
Timestamp:
Feb 19, 2006, 6:35:31 PM (19 years ago)
Author:
bensch
Message:

shared_lib: some functionality

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  
    3030*/
    3131DynamicLoader::DynamicLoader (const std::string& libName)
    32     : Factory(NULL, CL_NULL)
    3332{
    3433  this->setClassID(CL_DYNAMIC_LOADER, "DynamicLoader");
     
    6261}
    6362
    64 bool DynamicLoader::loadDyLib(const std::string& libName)
     63bool DynamicLoader::loadDyLib(const char* libName)
    6564{
    6665  void* handle;
    67   handle = dlopen(&libName[0], RTLD_NOW);
     66  handle = dlopen(libName, RTLD_NOW);
    6867  if(handle == NULL)
    6968  {
    70     PRINTF(0)("unable to load %s\n", &libName[0]);
     69    PRINTF(1)("unable to load %s: %s\n", libName, dlerror());
     70
    7171    return false;
    7272  }
  • branches/shared_lib/src/util/loading/dynamic_loader.h

    r7167 r7169  
    1111#include <string>
    1212
    13 #define DYNAMIC_LINKAGE_FACTORY(CLASS_NAME, CLASS_ID) \
    14           void* DynamicCreator(const TiXmlElement* root) { return new CLASS_NAME(root); };
    15 
    1613// FORWARD DECLARATION
    1714
    1815//! A class for ...
    19 class DynamicLoader : public Factory
     16class DynamicLoader : public BaseObject
    2017{
    2118
     
    2724  virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const;
    2825
    29   static bool loadDyLib(const std::string& libName);
     26  static bool loadDyLib(const char* libName);
    3027
    3128
Note: See TracChangeset for help on using the changeset viewer.