00001 #ifndef THREAD_CABINET_CLASS
00002 #define THREAD_CABINET_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "mechanisms_dll.h"
00019
00020
00021 class int_roller;
00022 class ithread;
00023 class thread_amorph;
00024 class unique_int;
00025
00027
00032 class MECHANISMS_CLASS_STYLE thread_cabinet
00033 {
00034 public:
00035 thread_cabinet();
00036 virtual ~thread_cabinet();
00037
00038 IMPLEMENT_CLASS_NAME("thread_cabinet");
00039
00040 unique_int add_thread(ithread *to_add, bool start_it, void *parm);
00042
00047 bool zap_thread(const unique_int &to_whack);
00049
00053 bool cancel_thread(const unique_int &to_cancel);
00055
00059 int threads() const;
00060
00061 int_set thread_ids() const;
00063
00064 bool any_running() const;
00066
00067 void start_all(void *pointer);
00069
00071 void cancel_all();
00073
00075 void stop_all();
00077
00080 ithread *get_thread(int index);
00082
00085 void clean_debris();
00087
00090 private:
00091 mutex *_lock;
00092 thread_amorph *_threads;
00093 int_roller *_next_id;
00094 int _no_additions;
00095 };
00096
00097 #endif
00098