Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

pluginmgr.hh

00001 /*
00002  * PIAVE - PIAVE Is A Video Editor
00003  *
00004  * Copyright (C) 2002 Rolf Dubitzky, rolf@dubitzky.de
00005  */
00006 
00007 /*
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software Foundation,
00020  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00023 
00028 #if ! defined( PLUGINMGR_HH )
00029 #define PLUGINMGR_HH
00030 
00031 // STD C++
00032 #include <iostream>
00033 #include <map>
00034 #include <string>
00035 
00036 // PIAVE
00037 #include "exception.hh"
00038 #include "plugin.hh"
00039 
00040 namespace PIAVE 
00041 {
00042     
00055     typedef std::map< std::string, Plugin * > PluginMap;
00056     class PluginMgr
00057     {
00058       private:
00060         PluginMgr() {};
00061         static PluginMgr * Inst() { if (_inst==0) {_inst=new PluginMgr();} return _inst;};
00062 
00063       public:
00064 
00065         static const PluginMap & getPluginMap() { return Inst()->_plugins; }
00066 
00067         static int    openDLL( const std::string & fileName );
00068         static int    openDLLsFromDir( const std::string & dirName, bool recurse = true );
00069         static int    openDLLsFromDefaultPath();
00070 
00071         static void   listPlugins( std::ostream & o );
00072         static void   getCapabilities( PropertyNode * c );
00073 
00082         static Plugin * find( PropertyNode * caps, PluginType_e type = PLUGIN_ANY_TYPE );
00083 
00085         static Plugin * find( std::string name, PluginType_e type = PLUGIN_ANY_TYPE );
00086         
00087       private:
00088         static PluginMgr * _inst;
00089 
00090         PluginMap    _plugins;
00091     };
00092     
00093 }
00094 
00095 #endif

Generated on Tue Oct 14 20:45:37 2003 for piave by doxygen1.2.18