Fawkes API Fawkes Development Version
blackboard.cpp
1
2/***************************************************************************
3 * blackboard.cpp - BlackBoard aspect for Fawkes
4 *
5 * Created: Thu Jan 11 16:28:58 2007
6 * Copyright 2006-2007 Tim Niemueller [www.niemueller.de]
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version. A runtime exception applies to
13 * this software (see LICENSE.GPL_WRE file mentioned below for details).
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21 */
22
23#include <aspect/blackboard.h>
24
25namespace fawkes {
26
27/** @class BlackBoardAspect <aspect/blackboard.h>
28 * Thread aspect to access to BlackBoard.
29 * Give this aspect to your thread to gain access to the BlackBoard.
30 * It is guaranteed that if used properly from within plugins that the
31 * blackboard member has been initialized properly.
32 * @ingroup Aspects
33 * @author Tim Niemueller
34 */
35
36/** @var BlackBoard * BlackBoardAspect::blackboard
37 * This is the BlackBoard instance you can use to interact with the
38 * BlackBoard. It is set when the thread starts.
39 */
40
41/** Constructor.
42 * @param owner owner name to set for opened interfaces. Set this to the
43 * plugin name for example. By default, the thread having the BlackBoardAspect
44 * will be used.
45 */
47{
48 add_aspect("BlackBoardAspect");
49 blackboard_owner_name_ = owner;
50 blackboard = 0;
51}
52
53/** Virtual empty destructor. */
55{
56}
57
58/** Init BlackBoard aspect.
59 * This set the BlackBoard interface manager that can be used to access the
60 * BB.
61 * It is guaranteed that this is called for a BlackBoardThread before start
62 * is called (when running regularly inside Fawkes).
63 * @param bb BlackBoard to use
64 */
65void
67{
68 blackboard = bb;
69}
70
71} // end namespace fawkes
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:49
BlackBoard * blackboard
This is the BlackBoard instance you can use to interact with the BlackBoard.
Definition: blackboard.h:44
virtual ~BlackBoardAspect()
Virtual empty destructor.
Definition: blackboard.cpp:54
BlackBoardAspect(const char *owner=NULL)
Constructor.
Definition: blackboard.cpp:46
void init_BlackBoardAspect(BlackBoard *bb)
Init BlackBoard aspect.
Definition: blackboard.cpp:66
The BlackBoard abstract class.
Definition: blackboard.h:46
Fawkes library namespace.