forked from Abc-Arbitrage/Disruptor-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathISequenceBarrier.h
More file actions
52 lines (41 loc) · 1.35 KB
/
ISequenceBarrier.h
File metadata and controls
52 lines (41 loc) · 1.35 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
#pragma once
#include <cstdint>
namespace Disruptor
{
/**
* Coordination barrier for tracking the cursor for producers and sequence of dependent IEventProcessor's for a RingBuffer<T>
*/
class ISequenceBarrier
{
public:
virtual ~ISequenceBarrier() = default;
/**
* Wait for the given sequence to be available for consumption.
*
* \param sequence sequence to wait for
* \returns the sequence up to which is available
*/
virtual std::int64_t waitFor(std::int64_t sequence) = 0;
/**
* Delegate a call to the Sequencer.cursor()
* Returns the value of the cursor for events that have been published.
*/
virtual std::int64_t cursor() = 0;
/**
* The current alert status for the barrier. Returns true if in alert otherwise false.
*/
virtual bool isAlerted() = 0;
/**
* Alert the IEventProcessor of a status change and stay in this status until cleared.
*/
virtual void alert() = 0;
/**
* Clear the current alert status.
*/
virtual void clearAlert() = 0;
/**
* Check if an alert has been raised and throw an AlertException if it has.
*/
virtual void checkAlert() = 0;
};
} // namespace Disruptor