Fawkes API  Fawkes Development Version
mainloop.cpp
00001 
00002 /***************************************************************************
00003  *  mainloop.cpp - Main loop aspect for Fawkes
00004  *
00005  *  Created: Sat Aug 02 00:16:30 2008
00006  *  Copyright  2008-2009  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <aspect/mainloop.h>
00025 
00026 namespace fawkes {
00027 
00028 /** @class MainLoopAspect <aspect/mainloop.h>
00029  * Thread aspect that allows to replace the main loop of the main application
00030  * of Fawkes.
00031  * Warning, replacing the main loop may severely interfere with the
00032  * functionality of Fawkes. Make sure that you know what the main loop
00033  * needs, what it has to do and what it should not do.
00034  *
00035  * At any given time there can only be one thread active with this aspect.
00036  *
00037  * @ingroup Aspects
00038  * @author Tim Niemueller
00039  */
00040 
00041 /** @var BlockedTimingExecutor *  MainLoopAspect::blocked_timing_executor
00042  * This is a blocked timing executor instance which can be used to run threads
00043  * with the BlockedTimingAspect.
00044  */
00045 
00046 /** Virtual empty destructor. */
00047 MainLoopAspect::~MainLoopAspect()
00048 {
00049 }
00050 
00051 
00052 /** Initialize main loop aspect.
00053  * Called from the Aspect initializer.
00054  * @param btexec blocked timing executor instance that can be used to run
00055  * threads that have the blocked timing aspect. It's accessible as
00056  * blocked_timing_aspect.
00057  */
00058 void
00059 MainLoopAspect::init_MainLoopAspect(BlockedTimingExecutor *btexec)
00060 {
00061   blocked_timing_executor = btexec;
00062 }
00063 
00064 } // end namespace fawkes