00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef STLFEATUREFACTORYPLUGIN_H
00026 #define STLFEATUREFACTORYPLUGIN_H
00027
00028
00029 #include <set>
00030 #include <string>
00031
00032
00033 class StlFeatureFactoryPlugin;
00034 class StlFeatureInterface;
00035
00036
00037 typedef const char* (*StlFeatureFactoryPluginIdFunction)();
00038 typedef StlFeatureFactoryPlugin* (*StlFeatureFactoryPluginInstanceFunction)();
00039
00040
00041 #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
00042 # define FUNC_EXPORT __declspec(dllexport)
00043 #else
00044 # define FUNC_EXPORT
00045 #endif
00046
00047
00048 #define StlFeatureFactoryPlugin_id \
00049 "edu.ocs.csse.monash.Digest.StlFeatureFactoryPlugin/1.0"
00050
00051
00052 #define EXPORT_STL_FEATURE_FACTORY_PLUGIN( PLUGIN ) \
00053 extern "C" FUNC_EXPORT const char* plugin_id() { \
00054 return StlFeatureFactoryPlugin_id; \
00055 } \
00056 extern "C" FUNC_EXPORT StlFeatureFactoryPlugin* plugin_instance() { \
00057 static StlFeatureFactoryPlugin* _instance = 0; \
00058 if ( !_instance ) \
00059 _instance = new PLUGIN; \
00060 return _instance; \
00061 }
00062
00063
00069 class StlFeatureFactoryPlugin {
00070
00071 public:
00072 virtual ~StlFeatureFactoryPlugin() {}
00073
00074 virtual std::set<std::string> keys() = 0;
00075 virtual StlFeatureInterface* create( const std::string& key ) = 0;
00076
00077 virtual std::string title( const std::string& key ) = 0;
00078 virtual std::string description( const std::string& key ) = 0;
00079 };
00080
00081
00082 #endif // ! STLFEATUREFACTORYPLUGIN_H