Fawkes API  Fawkes Development Version
thread_initializer.cpp
1 
2 /***************************************************************************
3  * thread_initializer.cpp - Thread initializer interface
4  *
5  * Created: Fri Jan 12 13:29:29 2007
6  * Copyright 2006-2007 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 <core/threading/thread_initializer.h>
25 
26 namespace fawkes {
27 
28 /** @class CannotInitializeThreadException core/threading/thread_initializer.h
29  * Thread cannot be initialized.
30  * Thrown if a thread could not be initialized for whatever reason.
31  * @ingroup Exceptions
32  */
33 
34 /** Constructor.
35  * Make sure you use append() or prepend() to add messages!
36  */
38 {
39 }
40 
41 /** Constructor.
42  * @param e exception to copy initial messages from
43  */
45 {
46  append(e);
47 }
48 
49 /** Constructor.
50  * @param format message format (reason or symptom of failure)
51  */
53 : Exception()
54 {
55  va_list va;
56  va_start(va, format);
57  append_va(format, va);
58  va_end(va);
59 }
60 
61 /** @class ThreadInitializer core/threading/thread_initializer.h
62  * Thread initializer interface.
63  * This interface is used by the ThreadManager. The init() method is called
64  * for each added thread. If there are any special needs that have to be
65  * initialized before the thread is started on the given real classes of
66  * the thread this is the way to do it. See Fawkes main application for
67  * an example.
68  * @author Tim Niemueller
69  *
70  * @fn void ThreadInitializer::init(Thread *thread) = 0
71  * This method is called by the ThreadManager for each newly added Thread.
72  * @param thread thread to initialize.
73  * @exception CannotInitializeThread thrown if thread can for not be
74  * initialized
75  */
76 
77 /** Virtual empty destructor. */
79 {
80 }
81 
82 } // end namespace fawkes
Base class for exceptions in Fawkes.
Definition: exception.h:36
void append(const char *format,...)
Append messages to the message list.
Definition: exception.cpp:333
void append_va(const char *format, va_list va)
Append messages to the message list.
Definition: exception.cpp:353
virtual ~ThreadInitializer()
Virtual empty destructor.
Fawkes library namespace.