35 #ifndef EMANENEMQUEUEDLAYER_HEADER_ 36 #define EMANENEMQUEUEDLAYER_HEADER_ 48 #include <unordered_map> 71 void start()
override;
91 const void * arg)
override;
94 template <
typename Function>
119 const void * arg) = 0;
123 using QCallback = std::function<void()>;
124 using MessageProcessingQueue = std::deque<QCallback>;
127 MessageProcessingQueue queue_;
133 using FileDescriptorStore = std::unordered_map<int,
136 FileDescriptorStore fileDescriptorStore_;
151 std::unique_ptr<Utils::StatisticHistogramTable<EventId>> pStatisticHistogramTable_;
155 void processWorkQueue();
157 void handleProcessConfiguration(
TimePoint enqueueTime,
160 void handleProcessDownstreamControl(
TimePoint enqueueTime,
163 void handleProcessDownstreamPacket(
TimePoint enqueueTime,
167 void handleProcessUpstreamPacket(
TimePoint enqueueTime,
171 void handleProcessUpstreamControl(
TimePoint enqueueTime,
174 void handleProcessEvent(
TimePoint enqueueTime,
178 void handleProcessTimedEvent(
TimePoint enqueueTime,
185 void removeFileDescriptor(
int iFd)
override;
187 void addFileDescriptor_i(
int iFd,
189 Callback callback)
override;
191 void enqueue_i(QCallback && callback);
198 void updateTimerStats(
TimePoint enqueueTime,
207 #endif //EMANENEMQUEUEDLAYER_HEADER_ std::string Serialization
A Packet class that allows upstream processing to strip layer headers as the packet travels up the st...
The Registrar interface provides access to all of the emulator registrars.
void processDownstreamControl(const ControlMessages &msgs) override
virtual void doProcessUpstreamPacket(UpstreamPacket &, const ControlMessages &)=0
std::function< void(int iFd)> Callback
NEMQueuedLayer(NEMId id, PlatformServiceProvider *pPlatformService)
std::list< const ControlMessage * > ControlMessages
virtual void doProcessEvent(const EventId &, const Serialization &)=0
Base class for NEMLayer containers. Builders construct NEMLayer objects to contain derived instances ...
void processUpstreamControl(const ControlMessages &msgs) override
virtual void doProcessUpstreamControl(const ControlMessages &)=0
virtual void doProcessDownstreamControl(const ControlMessages &)=0
void processConfiguration(const ConfigurationUpdate &update) override
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
virtual void doProcessConfiguration(const ConfigurationUpdate &)=0
std::function< void(const TimePoint &, const TimePoint &, const TimePoint &)> TimerCallback
File Descriptor service interface allows for adding arbitrary file descriptors for read or write proc...
void processTimedEvent(TimerEventId eventId, const TimePoint &expireTime, const TimePoint &scheduleTime, const TimePoint &fireTime, const void *arg) override
void initialize(Registrar ®istrar) override
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
Clock::time_point TimePoint
virtual void doProcessDownstreamPacket(DownstreamPacket &, const ControlMessages &)=0
void processEvent(const EventId &eventId, const Serialization &serialization) override
virtual void doProcessTimedEvent(TimerEventId eventId, const TimePoint &expireTime, const TimePoint &scheduleTime, const TimePoint &fireTime, const void *arg)=0
void processDownstreamPacket(DownstreamPacket &pkt, const ControlMessages &msgs) override
void processUpstreamPacket(UpstreamPacket &pkt, const ControlMessages &msgs) override
void processTimer(Function fn, const TimePoint &expireTime, const TimePoint &scheduleTime, const TimePoint &fireTime)
A layer stack with a porcessing queue between each layer to decouple to intra queue processing...