CatapultServer  v0.5.0.1 (Elephant)
ConsumerEntry.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "DisruptorBarrier.h"
23 
24 namespace catapult { namespace disruptor {
25 
27  class ConsumerEntry {
28  public:
30  explicit ConsumerEntry(size_t level)
31  : m_level(level)
32  , m_position(0)
33  {}
34 
37  return ++m_position;
38  }
39 
40  public:
43  return m_position;
44  }
45 
47  size_t level() const {
48  return m_level;
49  }
50 
51  private:
52  const size_t m_level;
54  };
55 }}
catapult::disruptor::ConsumerEntry::position
PositionType position() const
Returns current position (in the circular buffer).
Definition: ConsumerEntry.h:42
DisruptorBarrier.h
catapult::disruptor::PositionType
uint64_t PositionType
Position within disruptor components.
Definition: DisruptorTypes.h:29
catapult::disruptor::ConsumerEntry
Holds information about a consumer.
Definition: ConsumerEntry.h:27
catapult::disruptor::ConsumerEntry::ConsumerEntry
ConsumerEntry(size_t level)
Creates an entry with a level and position.
Definition: ConsumerEntry.h:30
catapult::disruptor::ConsumerEntry::level
size_t level() const
Returns consumer level.
Definition: ConsumerEntry.h:47
catapult::disruptor::ConsumerEntry::m_position
PositionType m_position
Definition: ConsumerEntry.h:53
catapult::disruptor::ConsumerEntry::advance
PositionType advance()
Advances the position.
Definition: ConsumerEntry.h:36
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::disruptor::ConsumerEntry::m_level
const size_t m_level
Definition: ConsumerEntry.h:52