Fawkes API  Fawkes Development Version
blackboard.cpp
00001 
00002 /***************************************************************************
00003  *  blackboard.cpp - BlackBoard aspect for Fawkes
00004  *
00005  *  Created: Thu Jan 11 16:28:58 2007
00006  *  Copyright  2006-2007  Tim Niemueller [www.niemueller.de]
00007  ****************************************************************************/
00008 
00009 /*  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version. A runtime exception applies to
00013  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00021  */
00022 
00023 #include <aspect/blackboard.h>
00024 
00025 namespace fawkes {
00026 #if 0 /* just to make Emacs auto-indent happy */
00027 }
00028 #endif
00029 
00030 /** @class BlackBoardAspect <aspect/blackboard.h>
00031  * Thread aspect to access to BlackBoard.
00032  * Give this aspect to your thread to gain access to the BlackBoard.
00033  * It is guaranteed that if used properly from within plugins that the
00034  * blackboard member has been initialized properly.
00035  * @ingroup Aspects
00036  * @author Tim Niemueller
00037  */
00038 
00039 
00040 /** @var BlackBoard *  BlackBoardAspect::blackboard
00041  * This is the BlackBoard instance you can use to interact with the
00042  * BlackBoard. It is set when the thread starts.
00043  */
00044 
00045 /** Constructor. */
00046 BlackBoardAspect::BlackBoardAspect()
00047 {
00048   add_aspect("BlackBoardAspect");
00049   blackboard = 0;
00050 }
00051 
00052 
00053 /** Virtual empty destructor. */
00054 BlackBoardAspect::~BlackBoardAspect()
00055 {
00056 }
00057 
00058 
00059 /** Init BlackBoard aspect.
00060  * This set the BlackBoard interface manager that can be used to access the
00061  * BB.
00062  * It is guaranteed that this is called for a BlackBoardThread before start
00063  * is called (when running regularly inside Fawkes).
00064  * @param bb BlackBoard to use
00065  */
00066 void
00067 BlackBoardAspect::init_BlackBoardAspect(BlackBoard *bb)
00068 {
00069   blackboard = bb;
00070 }
00071 
00072 } // end namespace fawkes