VR-Vantage
Loading...
Searching...
No Matches
DtTickable.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2022 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
9
10#pragma once
11
12#include <vrvCore/vrvCore.h>
13
15
16#include <vlutil/vlTime.h>
17
18
19namespace makVrv
20{
22
27 {
28 public:
37
38 public:
39
49 virtual bool needsUpdate( DtTime tNow );
50
52 virtual bool updateIfNeeded(DtTime tNow);
53
56 virtual void update( DtTime tNow ) = 0;
57
59 virtual ~DtTickable();
60
64 virtual void setTickableEnabled( bool enabled );
66
68
72 virtual void setIsThreadSafe(bool safe);
73 virtual bool isThreadSafe() const;
75
77
85
87
93 virtual void setUpdatePeriod( unsigned int period );
94 virtual unsigned int updatePeriod() const;
95
97 virtual bool adaptiveTickLodEnabled() const;
98
100 protected:
107
109 DtTickable() = delete;
110
112
113 protected:
116
117 protected:
119 unsigned int myFrameCounter;
120 unsigned int myFrameToUpdate;
121 unsigned int myUpdatePeriod;
122 unsigned int myTickableIndex;
123 // NOTE: Several derived updater classes also have a myLastUpdateTime
124 // member variable with its own initializer
125 // Double check whether you are modifying the child or the parent!
126 // Ideally all the children myLastUpdateTime should go away
130 };
131}
Base class to provide boost signal/slot management.
Class to manage disconnection of boost connections on deletion.
Definition DtSignalConnectionManager.h:21
unsigned int myFrameToUpdate
Definition DtTickable.h:120
virtual bool adaptiveTickLodEnabled() const
Is the adaptive tick LOD system enabled, overridden by subclasses.
TickableListState
Definition DtTickable.h:32
@ TickableNotOnList
Definition DtTickable.h:33
@ TickableOnThreadSafeList
Definition DtTickable.h:35
@ TickableOnMainList
Definition DtTickable.h:34
virtual void setUpdatePeriod(unsigned int period)
virtual void setTickableListState(TickableListState safeList)
Track which tickable list (if any) this tickable is on Since the tickable constructor puts ALL tickab...
DtSignalConnectionManager myConnections
Definition DtTickable.h:118
unsigned int myTickableIndex
Definition DtTickable.h:122
virtual void update(DtTime tNow)=0
unsigned int myUpdatePeriod
Definition DtTickable.h:121
DtTickableManagerInterface * myManager
Pointer to manager for removal during destruction.
Definition DtTickable.h:115
virtual void slot_managerAboutToBeDeleted()
virtual bool isThreadSafe() const
virtual TickableListState tickableListState() const
DtTime myLastUpdateTime
Definition DtTickable.h:127
virtual bool updateIfNeeded(DtTime tNow)
Calls needsUpdate(), and then calls update() if needsUpdate() is true.
virtual unsigned int updatePeriod() const
virtual bool needsUpdate(DtTime tNow)
DtTickable(DtTickableManagerInterface *manager)
TickableListState myTickableListState
Definition DtTickable.h:129
DtTickable()=delete
Unimplemented default CTOR.
virtual void setIsThreadSafe(bool safe)
Get/set whether this tickable can be updated in parallel with other tickables. Calling setIsThreadSaf...
virtual ~DtTickable()
Virtual DTOR.
unsigned int myFrameCounter
Definition DtTickable.h:119
bool myIsThreadSafe
Definition DtTickable.h:128
virtual void setTickableEnabled(bool enabled)
An abstract interface for managers of DtTickable objects.
Definition DtTickableManagerInterface.h:27
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
Contains DLL export macros.
#define DT_DLL_VRVCORE
Definition vrvCore.h:20