Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * thread_initializer.cpp - Thread initializer interface 00004 * 00005 * Created: Fri Jan 12 13:29:29 2007 00006 * Copyright 2006-2007 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 <core/threading/thread_initializer.h> 00025 00026 namespace fawkes { 00027 00028 /** @class CannotInitializeThreadException core/threading/thread_initializer.h 00029 * Thread cannot be initialized. 00030 * Thrown if a thread could not be initialized for whatever reason. 00031 * @ingroup Exceptions 00032 */ 00033 00034 /** Constructor. 00035 * Make sure you use append() or prepend() to add messages! 00036 */ 00037 CannotInitializeThreadException::CannotInitializeThreadException() 00038 : Exception() 00039 { 00040 } 00041 00042 00043 /** Constructor. 00044 * @param format message format (reason or symptom of failure) 00045 */ 00046 CannotInitializeThreadException::CannotInitializeThreadException(const char *format, ...) 00047 : Exception() 00048 { 00049 va_list va; 00050 va_start(va, format); 00051 append_va(format, va); 00052 va_end(va); 00053 } 00054 00055 00056 00057 /** @class ThreadInitializer core/threading/thread_initializer.h 00058 * Thread initializer interface. 00059 * This interface is used by the ThreadManager. The init() method is called 00060 * for each added thread. If there are any special needs that have to be 00061 * initialized before the thread is started on the given real classes of 00062 * the thread this is the way to do it. See Fawkes main application for 00063 * an example. 00064 * @author Tim Niemueller 00065 * 00066 * @fn void ThreadInitializer::init(Thread *thread) = 0 00067 * This method is called by the ThreadManager for each newly added Thread. 00068 * @param thread thread to initialize. 00069 * @exception CannotInitializeThread thrown if thread can for not be 00070 * initialized 00071 */ 00072 00073 /** Virtual empty destructor. */ 00074 ThreadInitializer::~ThreadInitializer() 00075 { 00076 } 00077 00078 00079 } // end namespace fawkes