Fawkes API  Fawkes Development Version
mainloop.cpp
1 
2 /***************************************************************************
3  * mainloop.cpp - Main loop aspect for Fawkes
4  *
5  * Created: Sat Aug 02 00:16:30 2008
6  * Copyright 2008-2010 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <aspect/mainloop.h>
25 
26 namespace fawkes {
27 #if 0 /* just to make Emacs auto-indent happy */
28 }
29 #endif
30 
31 /** @class MainLoopAspect <aspect/mainloop.h>
32  * Thread aspect that allows to replace the main loop of the main application
33  * of Fawkes.
34  * Warning, replacing the main loop may severely interfere with the
35  * functionality of Fawkes. Make sure that you know what the main loop
36  * needs, what it has to do and what it should not do.
37  *
38  * At any given time there can only be one thread active with this aspect.
39  *
40  * @ingroup Aspects
41  * @author Tim Niemueller
42  */
43 
44 /** @var BlockedTimingExecutor * MainLoopAspect::blocked_timing_executor
45  * This is a blocked timing executor instance which can be used to run threads
46  * with the BlockedTimingAspect.
47  */
48 
49 /** Constructor. */
51 {
52  add_aspect("MainLoopAspect");
53 }
54 
55 /** Virtual empty destructor. */
57 {
58 }
59 
60 
61 /** Initialize main loop aspect.
62  * Called from the Aspect initializer.
63  * @param btexec blocked timing executor instance that can be used to run
64  * threads that have the blocked timing aspect. It's accessible as
65  * blocked_timing_aspect.
66  */
67 void
69 {
70  blocked_timing_executor = btexec;
71 }
72 
73 } // end namespace fawkes
BlockedTimingExecutor * blocked_timing_executor
This is a blocked timing executor instance which can be used to run threads with the BlockedTimingAsp...
Definition: mainloop.h:46
Fawkes library namespace.
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:52
Blocked timing executor.
Definition: executor.h:35
void init_MainLoopAspect(BlockedTimingExecutor *btexec)
Initialize main loop aspect.
Definition: mainloop.cpp:68
virtual ~MainLoopAspect()
Virtual empty destructor.
Definition: mainloop.cpp:56
MainLoopAspect()
Constructor.
Definition: mainloop.cpp:50