Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009
00010 #ifndef threaded_H_
00011 #define threaded_H_
00012
00013 #include "lgrUtil.h"
00014 #include "lgrExceptions.h"
00015
00016 #include <vlutil/vlSmartPointers.h>
00017 #include <vlutil/vlThread.h>
00018 #include <vlutil/vlRunnable.h>
00019
00020 namespace MAKLogger
00021 {
00022
00023 class DtThreadable;
00024
00025 typedef DtBoost::shared_ptr<DtRunnable> DtRunnableSP;
00026
00029 class DT_DLL_LGRUTIL DtThreadedObject
00030 {
00031 public:
00032
00035 DtThreadedObject(DtRunnableSP ptr);
00036
00038 ~DtThreadedObject();
00039
00042 void start();
00043
00046 void join();
00047
00051 void stop(bool block);
00052
00054 bool running() const;
00055
00057 bool started() const;
00058
00061 void setRunnableObject(DtRunnableSP newObject);
00062
00064 DtRunnableSP runnableObject() const;
00065
00066 protected:
00067
00069 void setRunning(bool value);
00070
00071 bool myRunningFlag;
00072 DtRunnableSP myObject;
00073 DtBoost::shared_ptr<DtThread> myThread;
00074 mutable DtMutex myMutex;
00075
00076 };
00077
00078 }
00079
00080 #endif