forked from Abc-Arbitrage/Disruptor-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStubEvent.h
More file actions
69 lines (46 loc) · 1.39 KB
/
StubEvent.h
File metadata and controls
69 lines (46 loc) · 1.39 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <cstdint>
#include <string>
#include "Disruptor/IEventTranslatorVararg.h"
namespace Disruptor
{
namespace Tests
{
class StubEvent
{
typedef IEventTranslatorVararg< StubEvent, std::int32_t, std::string > EventTranslatorType;
class TwoTranslator : public EventTranslatorType
{
public:
void translateTo(StubEvent& event, std::int64_t sequence, const std::int32_t& arg0, const std::string& arg1) override;
};
public:
StubEvent()
: m_value(0)
, m_testString()
{}
explicit StubEvent(int i);
void operator=(const StubEvent& other)
{
m_value = other.m_value;
m_testString = other.m_testString;
}
int value() const;
void value(int i);
std::string testString() const;
void testString(std::string x);
void copy(const StubEvent& evt);
bool operator==(const StubEvent& rhs) const;
static const std::shared_ptr< TwoTranslator >& translator();
static const std::function< StubEvent() >& eventFactory();
private:
int m_value;
std::string m_testString;
};
} // namespace Tests
} // namespace Disruptor
#include <ostream>
namespace std
{
ostream& operator<<(ostream& stream, const Disruptor::Tests::StubEvent& event);
} // namespace std