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
26namespace fawkes {
27
28/** @class PluginDirectorAspect <aspect/plugin_director.h>
29 * Thread aspect to access the PluginManager.
30 * Give this aspect to your thread to gain access to the plugin manager.
31 * The plugin manager can be used to load and unload plugins. Use this
32 * carefully, as it can interfere with the internals of the runtime system.
33 *
34 * Note: This aspect can only be added for continuous threads, as plugins
35 * cannot be loaded while the main loop is running.
36 *
37 * @ingroup Aspects
38 * @author Tim Niemueller
39 */
40
41/** @var PluginManager * PluginDirectorAspect::plugin_manager
42 * This is the member used to access the PluginManager.
43 * The plugin manager will remain valid for the whole lifetime of the
44 * thread.
45 */
46
47/** Constructor. */
49{
50 add_aspect("PluginDirectorAspect");
51}
52
53/** Virtual empty Destructor. */
55{
56}
57
58/** Set the PluginManager.
59 * It is guaranteed that this is called for a configurable thread before
60 * Thread::start() is called (when running regularly inside Fawkes).
61 * @param manager PluginManager instance to use
62 */
63void
65{
66 plugin_manager = manager;
67}
68
69} // end namespace fawkes
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:49
virtual ~PluginDirectorAspect()
Virtual empty Destructor.
void init_PluginDirectorAspect(PluginManager *manager)
Set the PluginManager.
PluginManager * plugin_manager
This is the member used to access the PluginManager.
Fawkes Plugin Manager.
Definition: manager.h:48
Fawkes library namespace.