GestureRecognition/stlrecogniserfactoryplugin.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  stlrecogniserfactoryplugin.h
00004  *  Digest
00005  * 
00006  *  Created by Aidan Lane on Wed Jan 18 2006.
00007  *  Copyright (c) 2006 Optimisation and Constraint Solving Group,
00008  *  Monash University. All rights reserved.
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00023  */
00024 
00025 #ifndef STLRECOGNISERFACTORYPLUGIN_H
00026 #define STLRECOGNISERFACTORYPLUGIN_H
00027 
00028 
00029 #include <set>
00030 #include <string>
00031 
00032 
00033 class StlRecogniserFactoryPlugin;
00034 class StlRecogniserInterface;
00035 
00036 
00037 typedef const char* (*StlRecogniserFactoryPluginIdFunction)();
00038 typedef StlRecogniserFactoryPlugin* (*StlRecogniserFactoryPluginInstanceFunction)();
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 StlRecogniserFactoryPlugin_id \
00049   "edu.ocs.csse.monash.Digest.StlRecogniserFactoryPlugin/1.0"
00050 
00051 
00052 #define EXPORT_STL_RECOGNISER_FACTORY_PLUGIN( PLUGIN )                  \
00053   extern "C" FUNC_EXPORT const char* plugin_id() {                      \
00054     return StlRecogniserFactoryPlugin_id;                               \
00055   }                                                                     \
00056   extern "C" FUNC_EXPORT StlRecogniserFactoryPlugin* plugin_instance() { \
00057     static StlRecogniserFactoryPlugin* _instance = 0;                   \
00058     if ( !_instance )                                                   \
00059       _instance = new PLUGIN;                                           \
00060     return _instance;                                                   \
00061   }
00062 
00063 
00069 class StlRecogniserFactoryPlugin {
00070 
00071 public:
00072   virtual ~StlRecogniserFactoryPlugin() {}
00073 
00074   virtual std::set<std::string> keys() = 0;
00075   virtual StlRecogniserInterface* 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  // ! STLRECOGNISERFACTORYPLUGIN_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2