Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * plugin_director.cpp - Plugin director aspect for Fawkes 00004 * 00005 * Created: Thu Feb 12 12:02:58 2009 00006 * Copyright 2006-2010 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 #if 0 /* just to make Emacs auto-indent happy */ 00028 } 00029 #endif 00030 00031 /** @class PluginDirectorAspect <aspect/plugin_director.h> 00032 * Thread aspect to access the PluginManager. 00033 * Give this aspect to your thread to gain access to the plugin manager. 00034 * The plugin manager can be used to load and unload plugins. Use this 00035 * carefully, as it can interfere with the internals of the runtime system. 00036 * 00037 * Note: This aspect can only be added for continuous threads, as plugins 00038 * cannot be loaded while the main loop is running. 00039 * 00040 * @ingroup Aspects 00041 * @author Tim Niemueller 00042 */ 00043 00044 00045 /** @var PluginManager * PluginDirectorAspect::plugin_manager 00046 * This is the member used to access the PluginManager. 00047 * The plugin manager will remain valid for the whole lifetime of the 00048 * thread. 00049 */ 00050 00051 /** Constructor. */ 00052 PluginDirectorAspect::PluginDirectorAspect() 00053 { 00054 add_aspect("PluginDirectorAspect"); 00055 } 00056 00057 /** Virtual empty Destructor. */ 00058 PluginDirectorAspect::~PluginDirectorAspect() 00059 { 00060 } 00061 00062 00063 /** Set the PluginManager. 00064 * It is guaranteed that this is called for a configurable thread before 00065 * Thread::start() is called (when running regularly inside Fawkes). 00066 * @param manager PluginManager instance to use 00067 */ 00068 void 00069 PluginDirectorAspect::init_PluginDirectorAspect(PluginManager *manager) 00070 { 00071 plugin_manager = manager; 00072 } 00073 00074 } // end namespace fawkes