00001 #ifndef OBT_PLUGIN_INTERFACE_H 00002 #define OBT_PLUGIN_INTERFACE_H 00003 00004 #include "OBT.h" 00005 #include <string> 00006 00009 #if defined _MSC_VER 00010 # define OBT_EXPORT_API_DECL __declspec( dllexport ) 00011 #else 00012 # define OBT_EXPORT_API_DECL 00013 #endif 00014 00024 #define OBT_EXPORT_PLUGIN_API( PluginInterfaceImpl ) \ 00025 extern "C" \ 00026 { \ 00027 OBT_EXPORT_API_DECL OBT::PluginInterface* get_OBT_PluginInterface() \ 00028 { \ 00029 static PluginInterfaceImpl _pluginInterface ; \ 00030 return &_pluginInterface ; \ 00031 } \ 00032 } 00033 00034 00037 #ifdef _MSC_VER 00038 # define OBT_PLUGIN_HANDLE HINSTANCE 00039 #else 00040 # define OBT_PLUGIN_HANDLE void* 00041 #endif 00042 00043 namespace OBT 00044 { 00045 class PluginInformation ; 00046 class PluginLoaderImpl ; 00047 00061 class OBT_API PluginInterface 00062 { 00063 protected : 00065 PluginInterface() ; 00066 public: 00068 virtual ~PluginInterface() ; 00071 virtual const OBT::PluginInformation& getInformation() const = 0 ; 00080 virtual int type() const = 0 ; 00081 protected: 00082 friend class PluginLoaderImpl ; 00088 virtual bool init( const std::string& prm ) = 0 ; 00091 virtual bool finish() = 0 ; 00092 } ; 00093 00094 } 00095 00096 #endif // OBT_PLUGIN_INTERFACE_H