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 
25 namespace fawkes {
26 #if 0 /* just to make Emacs auto-indent happy */
27 }
28 #endif
29 
30 /** @class BlackBoardAspect <aspect/blackboard.h>
31  * Thread aspect to access to BlackBoard.
32  * Give this aspect to your thread to gain access to the BlackBoard.
33  * It is guaranteed that if used properly from within plugins that the
34  * blackboard member has been initialized properly.
35  * @ingroup Aspects
36  * @author Tim Niemueller
37  */
38 
39 
40 /** @var BlackBoard * BlackBoardAspect::blackboard
41  * This is the BlackBoard instance you can use to interact with the
42  * BlackBoard. It is set when the thread starts.
43  */
44 
45 /** Constructor.
46  * @param owner owner name to set for opened interfaces. Set this to the
47  * plugin name for example. By default, the thread having the BlackBoardAspect
48  * will be used.
49  */
51 {
52  add_aspect("BlackBoardAspect");
53  blackboard_owner_name_ = owner;
54  blackboard = 0;
55 }
56 
57 
58 /** Virtual empty destructor. */
60 {
61 }
62 
63 
64 /** Init BlackBoard aspect.
65  * This set the BlackBoard interface manager that can be used to access the
66  * BB.
67  * It is guaranteed that this is called for a BlackBoardThread before start
68  * is called (when running regularly inside Fawkes).
69  * @param bb BlackBoard to use
70  */
71 void
73 {
74  blackboard = bb;
75 }
76 
77 } // end namespace fawkes
void init_BlackBoardAspect(BlackBoard *bb)
Init BlackBoard aspect.
Definition: blackboard.cpp:72
Fawkes library namespace.
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:52
virtual ~BlackBoardAspect()
Virtual empty destructor.
Definition: blackboard.cpp:59
BlackBoardAspect(const char *owner=NULL)
Constructor.
Definition: blackboard.cpp:50
The BlackBoard abstract class.
Definition: blackboard.h:48
BlackBoard * blackboard
This is the BlackBoard instance you can use to interact with the BlackBoard.
Definition: blackboard.h:44