Fawkes API  Fawkes Development Version
plugin_director.cpp
1 
2 /***************************************************************************
3  * plugin_director.cpp - Plugin director aspect for Fawkes
4  *
5  * Created: Thu Feb 12 12:02:58 2009
6  * Copyright 2006-2010 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <aspect/plugin_director.h>
25 
26 namespace fawkes {
27 #if 0 /* just to make Emacs auto-indent happy */
28 }
29 #endif
30 
31 /** @class PluginDirectorAspect <aspect/plugin_director.h>
32  * Thread aspect to access the PluginManager.
33  * Give this aspect to your thread to gain access to the plugin manager.
34  * The plugin manager can be used to load and unload plugins. Use this
35  * carefully, as it can interfere with the internals of the runtime system.
36  *
37  * Note: This aspect can only be added for continuous threads, as plugins
38  * cannot be loaded while the main loop is running.
39  *
40  * @ingroup Aspects
41  * @author Tim Niemueller
42  */
43 
44 
45 /** @var PluginManager * PluginDirectorAspect::plugin_manager
46  * This is the member used to access the PluginManager.
47  * The plugin manager will remain valid for the whole lifetime of the
48  * thread.
49  */
50 
51 /** Constructor. */
53 {
54  add_aspect("PluginDirectorAspect");
55 }
56 
57 /** Virtual empty Destructor. */
59 {
60 }
61 
62 
63 /** Set the PluginManager.
64  * It is guaranteed that this is called for a configurable thread before
65  * Thread::start() is called (when running regularly inside Fawkes).
66  * @param manager PluginManager instance to use
67  */
68 void
70 {
71  plugin_manager = manager;
72 }
73 
74 } // end namespace fawkes
PluginManager * plugin_manager
This is the member used to access the PluginManager.
Fawkes library namespace.
virtual ~PluginDirectorAspect()
Virtual empty Destructor.
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:52
Fawkes Plugin Manager.
Definition: manager.h:51
void init_PluginDirectorAspect(PluginManager *manager)
Set the PluginManager.