MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrCheckpointPolicy.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef lgrCheckpointPolicy_H_
11 #define lgrCheckpointPolicy_H_
12 
13 #include <lgrCore/lgrCore.h>
14 
15 #include <lgrUtil/absoluteTime.h>
16 #include <lgrUtil/filePosition.h>
17 #include <lgrUtil/observe.h>
19 
20 namespace MAKLogger
21 {
22  class DtLgrFileOutput;
23  class DtPacket;
24  class DtMessageState;
25 
29  {
30  public:
32 
33 
34  virtual ~DtCheckpointPolicy();
35 
36 
37  enum Policy
38  {
41  ByTime
42  };
43 
44 
45  private:
49  DtCheckpointPolicy& operator=(const DtCheckpointPolicy&);
50  public:
51 
56  virtual bool timeForCheckpoint() const = 0;
57 
59  virtual void reset() = 0;
60 
62  virtual void checkpointWritten() = 0;
63 
66  virtual void packetWritten(const DtPacket&) = 0;
67 
69  virtual void connectFileOutput(DtMessageState*,DtLgrFileOutput*);
70 
72  virtual bool interactionsCheckpointed() const;
73 
75  virtual void setInteractionsCheckpointed(bool enable);
76 
77  protected:
78 
79  void onPacketWritten(const DtPacket&);
80 
83 
85 
86 
87  //DtObserverFunctor<DtCheckpointPolicy,DtPacket> myPacketWrittenObserver;
91  };
92 
96  {
97  public:
98  DT_VIRTUAL_CTR(DtCheckpointBySize,(size_t size))
100 
101 
102  virtual ~DtCheckpointBySize();
103 
104  private:
108  DtCheckpointBySize& operator=(const DtCheckpointBySize&);
109  public:
110 
116  virtual bool timeForCheckpoint() const;
117 
119  virtual void reset();
120 
122  virtual size_t sizeBetweenCheckpoints() const;
123 
125  virtual void checkpointWritten();
126 
128  virtual void packetWritten(const DtPacket&);
129 
130  protected:
131 
134 
137  };
138 
142  {
143  public:
146 
147 
148  virtual ~DtCheckpointByCount();
149 
155  virtual bool timeForCheckpoint() const;
156 
158  virtual void reset();
159 
161  virtual void checkpointWritten();
162 
164  virtual void packetWritten(const DtPacket&);
165 
166  protected:
169 
172  };
173 
177  {
178  public:
181 
182 
183  virtual ~DtCheckpointByTime();
184 
189  virtual bool timeForCheckpoint() const;
190 
192  virtual void reset();
193 
195  virtual void checkpointWritten();
196 
198  virtual void packetWritten(const DtPacket&);
199 
200  protected:
201 
205 
209  };
210 }
211 
212 #endif
#define DT_PURE_VIRTUAL_CTR(CLASS_NAME, ARG_TYPES_LIST)
Declare a pure virtual constructor.
Definition: virtualConstructor.h:138
PacketObserverFunctor myPacketWrittenObserver
Definition: lgrCheckpointPolicy.h:84
size_t myCheckpointSize
The size in bytes between checkpoints.
Definition: lgrCheckpointPolicy.h:133
Checkpoint policy which checkpoints are set by size.
Definition: lgrCheckpointPolicy.h:95
#define DT_VIRTUAL_BASE_CTR(BASE_NAME, ARG_TYPES_LIST)
Declare a Virtual Base Constructor Create using DT_VIRTUAL_CTR(CLASS_NAME,ARG_TYPES_LIST) Where BASE_...
Definition: virtualConstructor.h:118
size_t myCurrentDataSize
The current number of bytes written since last checkpoint.
Definition: lgrCheckpointPolicy.h:136
#define DT_VIRTUAL_CTR(CLASS_NAME, ARG_TYPES_LIST)
Declare a Virtual Constructor Create using DT_VIRTUAL_CTR(CLASS_NAME,ARG_TYPES_LIST) Where CLASS_NAME...
Definition: virtualConstructor.h:34
DtAbsoluteTime myLastCheckpointTime
Definition: lgrCheckpointPolicy.h:206
DtLgrFileOutput * myLgrFileOutput
Definition: lgrCheckpointPolicy.h:89
Contains MAKLogger::DtFilePosition typedef.
Relative Time, an elapsed duration of time, no implied measurement, could be seconds/cycles or ticks ...
Definition: absoluteTime.h:28
int myCheckpointCount
checkpoints between
Definition: lgrCheckpointPolicy.h:168
Contains DT_VIRTUAL_CTR DT_VIRTUAL_CTR_DEFAULTS DT_VIRTUAL_COPY_ASSIGN DT_VIRTUAL_BASE_CTR DT_PURE_VI...
bool myCheckpointInteractions
Definition: lgrCheckpointPolicy.h:90
DtAbsoluteTime myLastPacketTime
The time of the last checkpoint.
Definition: lgrCheckpointPolicy.h:208
DtMessageState * myMessageState
Definition: lgrCheckpointPolicy.h:88
Contains MAKLogger::DtObserver and MAKLogger::DtObserverCallback and MAKLogger::DtObserverFunctor cla...
Checkpoint policy which checkpoints are set by time.
Definition: lgrCheckpointPolicy.h:176
Checkpoint policy class responsible.
Definition: lgrCheckpointPolicy.h:28
int myCurrentPacketsCount
The number of packets written since last checkpoint.
Definition: lgrCheckpointPolicy.h:171
Contains MAKLogger::DtAbsoluteTime and MAKLogger::DtRelativeTime classes.
A generic packed of typed binary data.
Definition: packet.h:41
Checkpoint policy which checkpoints are set by count.
Definition: lgrCheckpointPolicy.h:141
#define DT_DLL_LGRCORE
Definition: lgrCore.h:19
Definition: lgrCheckpointPolicy.h:39
DtRelativeTime myCheckpointTime
The time duration between checkpoints.
Definition: lgrCheckpointPolicy.h:204
The Abstract message state maintained by the logger.
Definition: messageState.h:33
Policy
Definition: lgrCheckpointPolicy.h:37
Class responsible for message Output to a file.
Definition: lgrFileOutput.h:25
DtObserverFunctor< DtCheckpointPolicy, DtPacket > PacketObserverFunctor
Type of the functor connecting the checkpoint policy to the output.
Definition: lgrCheckpointPolicy.h:82
Absolute Time, a particular measured instance in time, could be thought of as a set of relative times...
Definition: absoluteTime.h:82
Definition: lgrCheckpointPolicy.h:40
Contains lgrCore library definitions.

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)