00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_RUNNABLE_H_
00028 #define CEYLAN_RUNNABLE_H_
00029
00030
00031 #include "CeylanTextDisplayable.h"
00032 #include "CeylanSystem.h"
00033
00034 #include <string>
00035
00036
00037
00038 namespace Ceylan
00039 {
00040
00041
00042 namespace System
00043 {
00044
00045
00047 class CEYLAN_DLL RunnableException : public SystemException
00048 {
00049
00050 public:
00051
00052 explicit RunnableException( const std::string message ) ;
00053
00054 virtual ~RunnableException() throw() ;
00055
00056 } ;
00057
00058
00059
00078 typedef void (*Callback) ( void * data ) ;
00079
00080
00081
00088 class CEYLAN_DLL Runnable : public Ceylan::TextDisplayable
00089 {
00090
00091
00092 public:
00093
00094
00095
00097 Runnable() ;
00098
00099
00100
00101
00102 explicit Runnable( const std::string & name ) ;
00103
00104
00105
00106
00107 virtual ~Runnable() throw() ;
00108
00109
00110
00118 virtual void run() = 0 ;
00119
00120
00121
00123 const std::string & getName() const ;
00124
00125
00126
00139 virtual const std::string toString(
00140 Ceylan::VerbosityLevels level = Ceylan::high ) const = 0 ;
00141
00142
00143
00144 private:
00145
00146
00148 std::string _name ;
00149
00150
00159 Runnable( const Runnable & source ) ;
00160
00161
00162
00171 Runnable & operator = ( const Runnable & source ) ;
00172
00173
00174 } ;
00175
00176
00177 }
00178
00179 }
00180
00181
00182
00183 #endif // CEYLAN_RUNNABLE_H_
00184