18
18
namespace Disruptor
19
19
{
20
20
21
- // / <summary>
22
- // / Convenience class for handling the batching semantics of consuming events from a <see cref="RingBuffer{T}"/>
23
- // / and delegating the available events to an <see cref="IEventHandler{T}"/>.
24
- // /
25
- // / If the <see cref="BatchEventProcessor{T}"/> also implements <see cref="ILifecycleAware"/> it will be notified just after the thread
26
- // / is started and just before the thread is shutdown.
27
- // / </summary>
28
- // / <typeparam name="T">Event implementation storing the data for sharing during exchange or parallel coordination of an event.</typeparam>
21
+ /* *
22
+ * Convenience class for handling the batching semantics of consuming events from a RingBuffer<T>
23
+ * and delegating the available events to an IEventHandler<T>. If the BatchEventProcessor<T>
24
+ * also implements ILifecycleAware it will be notified just after the thread is started and just before the thread is shutdown.
25
+ *
26
+ * \tparam T Event implementation storing the data for sharing during exchange or parallel coordination of an event.
27
+ */
29
28
template <class T >
30
29
class BatchEventProcessor : public IEventProcessor
31
30
{
32
31
public:
33
- // / <summary>
34
- // / Construct a <see cref="BatchEventProcessor{T}"/> that will automatically track the progress by updating its sequence when
35
- // / the <see cref="IEventHandler{T}.OnEvent"/> method returns.
36
- // / </summary>
37
- // / <param name="dataProvider">dataProvider to which events are published</param>
38
- // / <param name="sequenceBarrier">SequenceBarrier on which it is waiting.</param>
39
- // / <param name="eventHandler">eventHandler is the delegate to which events are dispatched.</param>
32
+ /* *
33
+ * Construct a BatchEventProcessor<T>
34
+ * that will automatically track the progress by updating its sequence when the IEventHandler<T>.OnEvent returns.
35
+ *
36
+ * \param dataProvider dataProvider to which events are published
37
+ * \param sequenceBarrier SequenceBarrier on which it is waiting.
38
+ * \param eventHandler eventHandler is the delegate to which events are dispatched.
39
+ */
40
40
BatchEventProcessor (const std::shared_ptr< IDataProvider< T > >& dataProvider,
41
41
const std::shared_ptr< ISequenceBarrier >& sequenceBarrier,
42
42
const std::shared_ptr< IEventHandler< T > >& eventHandler)
@@ -57,36 +57,39 @@ namespace Disruptor
57
57
m_timeoutHandler = std::dynamic_pointer_cast< ITimeoutHandler >(eventHandler);
58
58
}
59
59
60
- // / <summary>
61
- // / < see cref=" IEventProcessor. Sequence"/>
62
- // / </summary>
60
+ /* *
61
+ * \ see IEventProcessor:: Sequence
62
+ */
63
63
std::shared_ptr< ISequence > sequence () const override
64
64
{
65
65
return m_sequence;
66
66
};
67
67
68
- // / <summary>
69
- // / Signal that this <see cref="IEventProcessor"/> should stop when it has finished consuming at the next clean break.
70
- // / It will call <see cref="ISequenceBarrier.Alert"/> to notify the thread to check status.
71
- // / </summary>
68
+ /* *
69
+ * Signal that this IEventProcessor should stop when it has finished consuming at the next clean break. It will call ISequenceBarrier::Alert
70
+ * to notify the thread to check status.
71
+ * \see IEventProcessor
72
+ * \see ISequenceBarrier::Alert
73
+ */
72
74
void halt () override
73
75
{
74
76
m_running = false ;
75
77
m_sequenceBarrier->alert ();
76
78
}
77
79
78
- // / <summary>
79
- // / < see cref=" IEventProcessor. IsRunning"/>
80
- // / </summary>
80
+ /* *
81
+ * \ see IEventProcessor:: IsRunning
82
+ */
81
83
bool isRunning () const override
82
84
{
83
85
return m_running;
84
86
}
85
87
86
- // / <summary>
87
- // / Set a new <see cref="IExceptionHandler{T}"/> for handling exceptions propagated out of the <see cref="BatchEventProcessor{T}"/>
88
- // / </summary>
89
- // / <param name="exceptionHandler">exceptionHandler to replace the existing exceptionHandler.</param>
88
+ /* *
89
+ * Set a new IExceptionHandler<T> for handling exceptions propagated out of the BatchEventProcessor<T>
90
+ *
91
+ * \param exceptionHandler exceptionHandler to replace the existing exceptionHandler.
92
+ */
90
93
void setExceptionHandler (const std::shared_ptr< IExceptionHandler< T > >& exceptionHandler)
91
94
{
92
95
if (exceptionHandler == nullptr )
@@ -95,9 +98,9 @@ namespace Disruptor
95
98
m_exceptionHandler = exceptionHandler;
96
99
}
97
100
98
- // / <summary>
99
- // / It is ok to have another thread rerun this method after a halt().
100
- // / </summary>
101
+ /* *
102
+ * It is ok to have another thread rerun this method after a halt().
103
+ */
101
104
void run () override
102
105
{
103
106
if (m_running.exchange (true ) != false )
0 commit comments