forked from Abc-Arbitrage/Disruptor-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSequencerFixture.h
More file actions
30 lines (24 loc) · 806 Bytes
/
SequencerFixture.h
File metadata and controls
30 lines (24 loc) · 806 Bytes
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
#pragma once
#include "Disruptor/BlockingWaitStrategy.h"
#include "Disruptor/MultiProducerSequencer.h"
#include "Disruptor/Sequence.h"
#include "Disruptor/SingleProducerSequencer.h"
namespace Disruptor
{
namespace Tests
{
template <class T>
struct SequencerTestFixture
{
SequencerTestFixture()
: m_waitStrategy(std::make_shared< BlockingWaitStrategy >())
, m_sequencer(std::make_shared< T >(m_bufferSize, m_waitStrategy))
, m_gatingSequence(std::make_shared< Sequence >())
{}
const std::int32_t m_bufferSize = 16;
std::shared_ptr< IWaitStrategy > m_waitStrategy;
std::shared_ptr< T > m_sequencer;
std::shared_ptr< Sequence > m_gatingSequence;
};
} // namespace Tests
} // namespace Disruptor