forked from Abc-Arbitrage/Disruptor-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIEventHandler.h
More file actions
31 lines (25 loc) · 1007 Bytes
/
IEventHandler.h
File metadata and controls
31 lines (25 loc) · 1007 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
31
#pragma once
#include <cstdint>
namespace Disruptor
{
/**
* Callback interface to be implemented for processing events as they become available in the RingBuffer<T>
*
* \tparam T Type of events for sharing during exchange or parallel coordination of an event
* \remark See BatchEventProcessor<T>.SetExceptionHandler if you want to handle exceptions propagated out of the handler.
*/
template <class T>
class IEventHandler
{
public:
virtual ~IEventHandler() = default;
/**
* Called when a publisher has committed an event to the RingBuffer<T>
*
* \param data Data committed to the RingBuffer<T>
* \param sequence Sequence number committed to the RingBuffer<T>
* \param endOfBatch flag to indicate if this is the last event in a batch from the RingBuffer<T>
*/
virtual void onEvent(T& data, std::int64_t sequence, bool endOfBatch) = 0;
};
} // namespace Disruptor