source:
orxonox.OLD/trunk/src/lib/util/loading/dynamic_loader.h
@
8043
Last change on this file since 8043 was 7193, checked in by bensch, 19 years ago | |
---|---|
File size: 757 bytes |
Rev | Line | |
---|---|---|
[4838] | 1 | /*! |
[7167] | 2 | * @file dynamic_loader.h |
3 | * @brief Definition of The Dynamic Loader Factory. | |
[3245] | 4 | */ |
[1853] | 5 | |
[7167] | 6 | #ifndef _DYNAMIC_LOADER_H |
7 | #define _DYNAMIC_LOADER_H | |
[1853] | 8 | |
[7193] | 9 | #include "util/loading/factory.h" |
[1853] | 10 | |
[7167] | 11 | #include <string> |
[3543] | 12 | |
[7167] | 13 | #define DYNAMIC_LINKAGE_FACTORY(CLASS_NAME, CLASS_ID) \ |
14 | void* DynamicCreator(const TiXmlElement* root) { return new CLASS_NAME(root); }; | |
[3543] | 15 | |
[7167] | 16 | // FORWARD DECLARATION |
[2036] | 17 | |
[3955] | 18 | //! A class for ... |
[7167] | 19 | class DynamicLoader : public Factory |
20 | { | |
[1853] | 21 | |
[7167] | 22 | public: |
23 | DynamicLoader(const std::string& libName); | |
24 | virtual ~DynamicLoader(); | |
[1853] | 25 | |
[7167] | 26 | bool loadDynamicLib(const std::string& libName); |
27 | virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const; | |
[3245] | 28 | |
[7167] | 29 | static bool loadDyLib(const std::string& libName); |
[3245] | 30 | |
[7167] | 31 | |
32 | private: | |
33 | void* handle; | |
[1853] | 34 | }; |
35 | ||
[7167] | 36 | #endif /* _DYNAMIC_LOADER_H */ |
Note: See TracBrowser
for help on using the repository browser.