thread_cabinet.h

Go to the documentation of this file.
00001 #ifndef THREAD_CABINET_CLASS
00002 #define THREAD_CABINET_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : thread_cabinet                                                    *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2000-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "mechanisms_dll.h"
00019 
00020 // forward.
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 

Generated on Fri Nov 21 04:29:50 2008 for HOOPLE Libraries by  doxygen 1.5.1