JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
ThreadQueueUser.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 11/12/2018.
3 //
4 
5 #ifndef JODA_THREADQUEUEUSER_H
6 #define JODA_THREADQUEUEUSER_H
7 #include "IThreadUser.h"
8 
9 class ThreadQueueUser : public IThreadUser {
10  public:
11  size_t getQueueRead() {
13  return queueRead;
14  }
15 
16  size_t getQueueWritten() {
18  return queueWritten;
19  }
20 
21  size_t getQueueReadDelta() {
22  auto i = queueRead - queueReadDelta;
24  return i;
25  }
26 
30  return i;
31  }
32 
33  virtual void updateStatistics() = 0;
34 
35  protected:
36  size_t queueRead{};
37  size_t queueReadDelta{};
38  size_t queueWritten{};
40 
41  virtual void addStatistics(size_t read, size_t written) {
42  queueRead += read;
43  queueWritten += written;
44  }
45 };
46 #endif // JODA_THREADQUEUEUSER_H
Definition: IThreadUser.h:13
Definition: ThreadQueueUser.h:9
virtual void updateStatistics()=0
virtual void addStatistics(size_t read, size_t written)
Definition: ThreadQueueUser.h:41
size_t getQueueRead()
Definition: ThreadQueueUser.h:11
size_t queueWrittenDelta
Definition: ThreadQueueUser.h:39
size_t queueRead
Definition: ThreadQueueUser.h:36
size_t getQueueReadDelta()
Definition: ThreadQueueUser.h:21
size_t queueReadDelta
Definition: ThreadQueueUser.h:37
size_t getQueueWrittenDelta()
Definition: ThreadQueueUser.h:27
size_t queueWritten
Definition: ThreadQueueUser.h:38
size_t getQueueWritten()
Definition: ThreadQueueUser.h:16