00001 00002 /*************************************************************************** 00003 * plugin_director.h - Plugin director aspect for Fawkes 00004 * 00005 * Created: Thu Feb 12 12:02:58 2009 00006 * Copyright 2006-2009 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 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. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #include <aspect/plugin_director.h> 00025 00026 namespace fawkes { 00027 00028 /** @class PluginDirectorAspect <aspect/plugin_director.h> 00029 * Thread aspect to access the PluginManager. 00030 * Give this aspect to your thread to gain access to the plugin manager. 00031 * The plugin manager can be used to load and unload plugins. Use this 00032 * carefully, as it can interfere with the internals of the runtime system. 00033 * 00034 * Note: This aspect can only be added for continuous threads, as plugins 00035 * cannot be loaded while the main loop is running. 00036 * 00037 * @ingroup Aspects 00038 * @author Tim Niemueller 00039 */ 00040 00041 00042 /** @var PluginManager * PluginDirectorAspect::plugin_manager 00043 * This is the member used to access the PluginManager. 00044 * The plugin manager will remain valid for the whole lifetime of the 00045 * thread. 00046 */ 00047 00048 /** Virtual empty Destructor. */ 00049 PluginDirectorAspect::~PluginDirectorAspect() 00050 { 00051 } 00052 00053 00054 /** Set the PluginManager. 00055 * It is guaranteed that this is called for a configurable thread before 00056 * Thread::start() is called (when running regularly inside Fawkes). 00057 * @param manager PluginManager instance to use 00058 */ 00059 void 00060 PluginDirectorAspect::init_PluginDirectorAspect(PluginManager *manager) 00061 { 00062 plugin_manager = manager; 00063 } 00064 00065 } // end namespace fawkes