threaded.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
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

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)