-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathReader.h
49 lines (37 loc) · 982 Bytes
/
Reader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "Events.h"
#include <array>
#include <cstdio>
#include <cstring>
#include <functional>
#include <string>
#include <vector>
namespace wwhrt {
// This file should not be modified.
class Subscriber {
public:
virtual ~Subscriber() {}
virtual void onAdd(const CryptoAdd&) {}
virtual void onUpdate(const CryptoUpdate&) {}
virtual void onDelete(const CryptoDelete&) {}
};
// The reader class is used for generating event callbacks from events
// stored in a flat file
class Reader {
public:
Reader(const char* filePath);
Reader(const Reader&) = delete;
Reader& operator=(const Reader&) = delete;
Reader(Reader&&) = delete;
Reader& operator=(Reader&&) = delete;
~Reader();
void addSubscriber(Subscriber* subscriber) {
subscribers.push_back(subscriber);
}
void run();
static int32_t breakOnSeqNum;
private:
FILE* fp;
std::vector<Subscriber*> subscribers;
};
} // namespace wwhrt