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
00076 typedef void (*Callback) ( void * data ) ;
00077
00078
00079
00086 class CEYLAN_DLL Runnable : public Ceylan::TextDisplayable
00087 {
00088
00089
00090 public:
00091
00092
00093
00095 Runnable() ;
00096
00097
00098
00099
00100 explicit Runnable( const std::string & name ) ;
00101
00102
00103
00104
00105 virtual ~Runnable() throw() ;
00106
00107
00108
00116 virtual void run() = 0 ;
00117
00118
00119
00121 const std::string & getName() const ;
00122
00123
00124
00137 virtual const std::string toString(
00138 Ceylan::VerbosityLevels level = Ceylan::high ) const = 0 ;
00139
00140
00141
00142 private:
00143
00144
00146 std::string _name ;
00147
00148
00157 Runnable( const Runnable & source ) ;
00158
00159
00160
00169 Runnable & operator = ( const Runnable & source ) ;
00170
00171
00172 } ;
00173
00174
00175 }
00176
00177 }
00178
00179
00180
00181 #endif // CEYLAN_RUNNABLE_H_
00182