Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PluginManager.H

00001 /* $Id: PluginManager.H,v 1.2 2000/11/03 22:03:28 rpav Exp $
00002  *
00003  * SFW - Studio FrameWork
00004  * Copyright (C) 2000  Ryan Pavlik
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  */
00021 
00022 #ifndef PLUGINMANAGER_H
00023 #define PLUGINMANAGER_H
00024 
00025 #include <string>
00026 #include <list>
00027 #include <set>
00028 #include "Comparator.H"
00029 #include "Plugin.H"
00030 #include "Thread.H"
00031 
00032 namespace SFW {
00033     
00034     class PluginSet : public Object, public set<Plugin*,Comparator> {
00035     public:
00036     TYPE_INFO(SFW::PluginSet, SFW::Object);
00037     };
00038     
00039     typedef set<string> PluginPathSet;
00040 
00041     class PluginManager {
00042     PluginPathSet paths;
00043     PluginSet     plugins;
00044     Mutex         mutex;
00045 
00046     void addPluginsFromPath(PluginSet &pl, string path);
00047     void addMultiple(string &path);
00048     
00049     public:
00050     PluginManager();
00051     ~PluginManager();
00052 
00053     /* Plugin paths */
00054     bool addPath(string path);
00055     bool delPath(string path);
00056 
00057     /* Plugins */
00058         Plugin*    get(Plugin *p);
00059     PluginSet* getSet();
00060     PluginSet* getSet(string type);
00061     bool       add(Plugin *p);
00062     bool       remove(Plugin *p);
00063     };
00064 
00065     extern PluginManager PM;
00066 }
00067 
00068 #endif /* PLUGINMANAGER_H */

Generated at Tue Jan 2 15:38:34 2001 for SFW by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000