Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b332b3

Browse files
committed
Use Doxygen style comments
1 parent c2b4238 commit 5b332b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1285
-1316
lines changed

Disruptor/AggregateEventHandler.h

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,31 @@
1010
namespace Disruptor
1111
{
1212

13-
/// <summary>
14-
/// An aggregate collection of <see cref="IEventHandler{T}"/> that get called in sequence for each event.
15-
/// </summary>
16-
/// <typeparam name="T">event implementation storing the data for sharing during exchange or parallel coordination of an event</typeparam>
13+
/**
14+
* An aggregate collection of IEventHandler<T> that get called in sequence for each event.
15+
* \tparam T event implementation storing the data for sharing during exchange or parallel coordination of an event
16+
*/
1717
template <class T>
1818
class AggregateEventHandler : public IEventHandler< T >, public ILifecycleAware
1919
{
2020
public:
21-
/// <summary>
22-
/// Construct an aggregate collection of <see cref="IEventHandler{T}"/> to be called in sequence.
23-
/// </summary>
24-
/// <param name="eventHandlers">to be called in sequence</param>
21+
/**
22+
* Construct an aggregate collection of IEventHandler<T>/> to be called in sequence.
23+
*
24+
* \param eventHandlers to be called in sequence
25+
*/
2526
explicit AggregateEventHandler(const std::vector< std::shared_ptr< IEventHandler< T > > >& eventHandlers = {})
2627
: m_eventHandlers(eventHandlers)
2728
{
2829
}
2930

30-
/// <summary>
31-
/// Called when a publisher has committed an event to the <see cref="RingBuffer{T}"/>
32-
/// </summary>
33-
/// <param name="data">Data committed to the <see cref="RingBuffer{T}"/></param>
34-
/// <param name="sequence">Sequence number committed to the <see cref="RingBuffer{T}"/></param>
35-
/// <param name="endOfBatch">flag to indicate if this is the last event in a batch from the <see cref="RingBuffer{T}"/></param>
31+
/**
32+
* Called when a publisher has committed an event to the RingBuffer<T>
33+
*
34+
* \param data Data committed to the RingBuffer<T>/>
35+
* \param sequence Sequence number committed to theRingBuffer<T>/>
36+
* \param endOfBatch flag to indicate if this is the last event in a batch from theRingBuffer<T>/>
37+
*/
3638
void onEvent(T& data, std::int64_t sequence, bool endOfBatch) override
3739
{
3840
for (auto i = 0u; i < m_eventHandlers.size(); ++i)
@@ -41,9 +43,9 @@ namespace Disruptor
4143
}
4244
}
4345

44-
///<summary>
45-
/// Called once on thread start before first event is available.
46-
///</summary>
46+
/**
47+
* Called once on thread start before first event is available.
48+
*/
4749
void onStart() override
4850
{
4951
for (auto&& eventHandler : m_eventHandlers)
@@ -54,9 +56,9 @@ namespace Disruptor
5456
}
5557
}
5658

57-
/// <summary>
58-
/// Called once just before the thread is shutdown.
59-
/// </summary>
59+
/**
60+
* Called once just before the thread is shutdown.
61+
*/
6062
void onShutdown() override
6163
{
6264
for (auto&& eventHandler : m_eventHandlers)

Disruptor/BasicExecutor.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ namespace Disruptor
1111
class ITaskScheduler;
1212

1313

14-
/// <summary>
15-
/// TaskScheduler implementation for IExecutor
16-
/// </summary>
14+
/**
15+
* TaskScheduler implementation for IExecutor
16+
*/
1717
class BasicExecutor : public IExecutor
1818
{
1919
public:
20-
/// <summary>
21-
/// Create a new <see cref="BasicExecutor"/> with a given <see cref="TaskScheduler"/>
22-
/// that will handle low-level queuing of commands execution.
23-
/// </summary>
20+
/**
21+
* Create a new BasicExecutor with a given TaskScheduler that will handle low-level queuing of commands execution.
22+
*/
2423
explicit BasicExecutor(const std::shared_ptr< ITaskScheduler >& taskScheduler);
2524

26-
/// <summary>
27-
/// Start a new task executiong the given command in the current taskscheduler
28-
/// </summary>
29-
/// <param name="command"></param>
25+
/**
26+
* Start a new task executiong the given command in the current taskscheduler
27+
* \param command
28+
*/
3029
std::future< void > execute(const std::function< void() >& command) override;
3130

3231
private:

Disruptor/BatchEventProcessor.h

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@
1818
namespace Disruptor
1919
{
2020

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+
*/
2928
template <class T>
3029
class BatchEventProcessor : public IEventProcessor
3130
{
3231
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+
*/
4040
BatchEventProcessor(const std::shared_ptr< IDataProvider< T > >& dataProvider,
4141
const std::shared_ptr< ISequenceBarrier >& sequenceBarrier,
4242
const std::shared_ptr< IEventHandler< T > >& eventHandler)
@@ -57,36 +57,39 @@ namespace Disruptor
5757
m_timeoutHandler = std::dynamic_pointer_cast< ITimeoutHandler >(eventHandler);
5858
}
5959

60-
/// <summary>
61-
/// <see cref="IEventProcessor.Sequence"/>
62-
/// </summary>
60+
/**
61+
* \see IEventProcessor::Sequence
62+
*/
6363
std::shared_ptr< ISequence > sequence() const override
6464
{
6565
return m_sequence;
6666
};
6767

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+
*/
7274
void halt() override
7375
{
7476
m_running = false;
7577
m_sequenceBarrier->alert();
7678
}
7779

78-
/// <summary>
79-
/// <see cref="IEventProcessor.IsRunning"/>
80-
/// </summary>
80+
/**
81+
* \see IEventProcessor::IsRunning
82+
*/
8183
bool isRunning() const override
8284
{
8385
return m_running;
8486
}
8587

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+
*/
9093
void setExceptionHandler(const std::shared_ptr< IExceptionHandler< T > >& exceptionHandler)
9194
{
9295
if (exceptionHandler == nullptr)
@@ -95,9 +98,9 @@ namespace Disruptor
9598
m_exceptionHandler = exceptionHandler;
9699
}
97100

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+
*/
101104
void run() override
102105
{
103106
if (m_running.exchange(true) != false)

Disruptor/BlockingWaitStrategy.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,24 @@
88
namespace Disruptor
99
{
1010

11-
/// <summary>
12-
/// Blocking strategy that uses a lock and condition variable for <see cref="IEventProcessor"/>s waiting on a barrier.
13-
///
14-
/// This strategy should be used when performance and low-latency are not as important as CPU resource.
15-
/// </summary>
11+
/**
12+
* Blocking strategy that uses a lock and condition variable for IEventProcessor's waiting on a barrier.
13+
* This strategy should be used when performance and low-latency are not as important as CPU resource.
14+
*/
1615
class BlockingWaitStrategy : public IWaitStrategy
1716
{
1817
public:
19-
/// <summary>
20-
/// <see cref="IWaitStrategy.WaitFor"/>
21-
/// </summary>
18+
/**
19+
* \see IWaitStrategy::waitFor
20+
*/
2221
std::int64_t waitFor(std::int64_t sequence,
2322
const std::shared_ptr< Sequence >& cursor,
2423
const std::shared_ptr< ISequence >& dependentSequence,
2524
const std::shared_ptr< ISequenceBarrier >& barrier) override;
2625

27-
/// <summary>
28-
/// <see cref="IWaitStrategy.SignalAllWhenBlocking"/>
29-
/// </summary>
26+
/**
27+
* \see IWaitStrategy::signalAllWhenBlocking
28+
*/
3029
void signalAllWhenBlocking() override;
3130

3231
void writeDescriptionTo(std::ostream& stream) const override;

Disruptor/BusySpinWaitStrategy.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,24 @@
88
namespace Disruptor
99
{
1010

11-
/// <summary>
12-
/// Busy Spin strategy that uses a busy spin loop for <see cref="IEventProcessor"/>s waiting on a barrier.
13-
///
14-
/// This strategy will use CPU resource to avoid syscalls which can introduce latency jitter. It is best
15-
/// used when threads can be bound to specific CPU cores.
16-
/// </summary>
11+
/**
12+
* Busy Spin strategy that uses a busy spin loop for IEventProcessor's waiting on a barrier.
13+
* This strategy will use CPU resource to avoid syscalls which can introduce latency jitter. It is best used when threads can be bound to specific CPU cores.
14+
*/
1715
class BusySpinWaitStrategy : public IWaitStrategy
1816
{
1917
public:
20-
/// <summary>
21-
/// <see cref="IWaitStrategy.WaitFor"/>
22-
/// </summary>
18+
/**
19+
* \see IWaitStrategy::waitFor
20+
*/
2321
std::int64_t waitFor(std::int64_t sequence,
2422
const std::shared_ptr< Sequence >& cursor,
2523
const std::shared_ptr< ISequence >& dependentSequence,
2624
const std::shared_ptr< ISequenceBarrier >& barrier) override;
2725

28-
/// <summary>
29-
/// <see cref="IWaitStrategy.SignalAllWhenBlocking"/>
30-
/// </summary>
26+
/**
27+
* \see IWaitStrategy::signalAllWhenBlocking
28+
*/
3129
void signalAllWhenBlocking() override;
3230

3331
void writeDescriptionTo(std::ostream& stream) const override;

0 commit comments

Comments
 (0)