#include <osaDynamicLoader.h>
Inheritance diagram for osaDynamicLoader:


This class is used to dynamically load a shared library file. If a path is specified, the library file must exist on that path; otherwise, the "standard" library paths are used.
This class should be used to dynamically load a library file if it contains classes that are derived from cmnGenericObject, assuming that they are set up for dynamic creation (e.g., CMN_DYNAMIC_CREATION flag used with CMN_DECLARE_SERVICES). For example, if the class "derivedClass" exists in a library file with the same name, the file can be dynamically loaded and a new instance created as follows:
osaDynamicLoader dload; dload.Load("derivedClass"); cmnGenericObject *obj = cmnObjectRegister::Instance()->Create("derivedClass");
dynamic_cast can be used to cast obj up the hierarchy.
Definition at line 56 of file osaDynamicLoader.h.
| osaDynamicLoader::osaDynamicLoader | ( | ) | [inline] |
Default constructor. Does nothing.
Definition at line 63 of file osaDynamicLoader.h.
| virtual osaDynamicLoader::~osaDynamicLoader | ( | ) | [inline, virtual] |
Destructor. Does not unload library in case any objects created from within the library still exist. To unload library, call Unload().
Definition at line 67 of file osaDynamicLoader.h.
| bool osaDynamicLoader::Load | ( | const char * | file, | |
| const char * | path = 0 | |||
| ) |
Dynamically load the specified shared library.
| file | Name of shared library file to load (do not include extension) | |
| path | Path to file (0 -> use default library load paths) |
| void osaDynamicLoader::UnLoad | ( | ) |
Unload the shared library file (if supported by operating system).