00001 /*************************************************************************** 00002 LOW_thread_runable.h - description 00003 ------------------- 00004 begin : Thu Oct 2 2003 00005 copyright : (C) 2003 by Harald Roelle 00006 email : roelle@informatik.uni-muenchen.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef LOW_THREAD_RUNABLE_H 00019 #define LOW_THREAD_RUNABLE_H 00020 00021 00022 #include "LOW_thread_thread.h" 00023 00024 00025 /** Interface class for objects implementing the "body" of a thread. 00026 00027 This class is thread-safe. 00028 00029 @see LOW_thread_thread 00030 00031 @author Harald Roelle 00032 */ 00033 class LOW_thread_runable { 00034 00035 //======================================================================================= 00036 protected: 00037 00038 //===================================================================================== 00039 // 00040 // friends 00041 // 00042 00043 /** Needed to grant access to the protected run() method. 00044 Gives LOW_thread_thread the permission to access the run() method. 00045 */ 00046 friend void* LOW_thread_thread::threadRunner( void*); 00047 00048 00049 //===================================================================================== 00050 // 00051 // methods 00052 // 00053 00054 /** Method to be called when thread gets started. 00055 The thread terminates when this method returns. 00056 00057 @param inMyThread Pointer to the thread. 00058 00059 @return Return value of the thread on termination. 00060 */ 00061 virtual int run( LOW_thread_thread *inMyThread) = 0; 00062 00063 }; 00064 00065 #endif