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-2010  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 #if 0 /* just to make Emacs auto-indent happy */
00028 }
00029 #endif
00030 
00031 /** @class MainLoopAspect <aspect/mainloop.h>
00032  * Thread aspect that allows to replace the main loop of the main application
00033  * of Fawkes.
00034  * Warning, replacing the main loop may severely interfere with the
00035  * functionality of Fawkes. Make sure that you know what the main loop
00036  * needs, what it has to do and what it should not do.
00037  *
00038  * At any given time there can only be one thread active with this aspect.
00039  *
00040  * @ingroup Aspects
00041  * @author Tim Niemueller
00042  */
00043 
00044 /** @var BlockedTimingExecutor *  MainLoopAspect::blocked_timing_executor
00045  * This is a blocked timing executor instance which can be used to run threads
00046  * with the BlockedTimingAspect.
00047  */
00048 
00049 /** Constructor. */
00050 MainLoopAspect::MainLoopAspect()
00051 {
00052   add_aspect("MainLoopAspect");
00053 }
00054 
00055 /** Virtual empty destructor. */
00056 MainLoopAspect::~MainLoopAspect()
00057 {
00058 }
00059 
00060 
00061 /** Initialize main loop aspect.
00062  * Called from the Aspect initializer.
00063  * @param btexec blocked timing executor instance that can be used to run
00064  * threads that have the blocked timing aspect. It's accessible as
00065  * blocked_timing_aspect.
00066  */
00067 void
00068 MainLoopAspect::init_MainLoopAspect(BlockedTimingExecutor *btexec)
00069 {
00070   blocked_timing_executor = btexec;
00071 }
00072 
00073 } // end namespace fawkes