Fawkes API  Fawkes Development Version
thread_loop_listener.cpp
1 
2 /***************************************************************************
3  * thread_loop_listener.cpp - thread notification listener interface
4  *
5  * Created: Thu Feb 19 13:50:42 2015
6  * Copyright 2015 Till Hofmann
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 <core/threading/thread_loop_listener.h>
25 
26 namespace fawkes {
27 
28 /** @class ThreadLoopListener <core/threading/thread_loop_listener.h>
29  * Thread loop listener interface.
30  * A thread loop listener can be added to a thread to define pre and post loop
31  * tasks, which are executed before and after every loop.
32  *
33  * @author Till Hofmann
34  *
35  * @fn void ThreadLoopListener::pre_loop(Thread thread*)
36  * This is called by the thread every time before loop() is called.
37  * @param thread thread whose loop() is will be called.
38  *
39  * @fn void ThreadLoopListener::post_loop(Thread thread*)
40  * This is called by the thread every time after loop() returned.
41  * @param thread thread whose loop() just returned.
42  */
43 
44 /** Virtual empty destructor. */
46 {
47 }
48 
49 /** Empty stub for the pre loop function of the loop listener.
50  * This function is called right before the loop of the thread with the aspect.
51  * Provide a stub such that not every derived class must implement the function.
52  * @param thread thread this loop listener belongs to
53  */
54 void
56 {
57 }
58 
59 /** Empty stub for the post loop function of the loop listener.
60  * This function is called right after the loop of the thread with the aspect.
61  * Provide a stub such that not every derived class must implement the function.
62  * @param thread thread this loop listener belongs to
63  */
64 void
66 {
67 }
68 
69 } // end namespace fawkes
virtual void post_loop(Thread *thread)
This is called by the thread every time after loop() returned.
Fawkes library namespace.
Thread class encapsulation of pthreads.
Definition: thread.h:45
virtual void pre_loop(Thread *thread)
This is called by the thread every time before loop() is called.
virtual ~ThreadLoopListener()
Virtual empty destructor.