VR-Forces 4.0.4 Class Documentation
include/vrfcore/timer.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2006 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: timer.h,v $ $Revision: 1.8 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00021 
00022 #ifndef DtTimer_H_
00023 #define DtTimer_H_
00024 
00025 #include <vrfutil/vlClock.h>
00026 #include <vlutil/vlList.h>
00027 
00028 class DtScheduler;
00029 class DtTimer;
00030 
00031 typedef void (*DtTimerCallbackFcn)(DtTimer *timer);
00032 
00044 #include "vrfcore/vrfcoreDefines.h"
00045 class DT_DLL_vrfcore DtTimer : public DtListedObj
00046 {
00047 
00048 public:
00049 
00059    DtTimer(const unsigned int type, const DtTime fireTime, 
00060       const DtTimerCallbackFcn callback, void *usr);
00061 
00063    DtTimer(const DtTimer & orig);
00064 
00066    DtTimer & operator=(const DtTimer & orig);
00067 
00069    virtual ~DtTimer();
00070 
00072    virtual bool tick(const DtTime simTime);
00073 
00077    virtual void reset(const DtTime fireTime);
00078 
00082    virtual void cancel();
00083 
00087    virtual void fire();  
00088 
00090    virtual bool fired() const;
00091 
00093    virtual DtTime fireTime()  const;
00094 
00098    virtual unsigned int timerType() const;
00099 
00101    virtual void * usrData();
00102 
00105    virtual bool cancelled() const;
00106 
00109    virtual void setResortPending();
00110    virtual void clearResortPending();
00111    virtual bool resortPending() const;
00112 
00119    virtual void setDeleteAfterFire();   
00120    virtual void clearDeleteAfterFire();
00121 
00127    virtual bool deleteAfterFire() const;
00128 
00131    virtual bool managed() const;
00132 
00134    virtual void setScheduler(DtScheduler * scheduler);
00135 
00136 protected:
00137 
00138    DtScheduler *            myScheduler; 
00139    const DtTimerCallbackFcn myCallback;
00140    const unsigned int       myType;
00143    void *                   myUsrData;
00144    bool                     myFired;
00145    bool                     myDeleteAfterFire;
00146    bool                     myCancelled;
00147    DtTime                   myFireTime;
00148    bool                     myResortPending;
00149 };
00150 
00151 #endif
00152 
00153 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)