lintel 0.2.0
Loading...
Searching...
No Matches
EventBusService.h
Go to the documentation of this file.
1#ifndef LINTEL_EVENTBUSSERVICE_H
2#define LINTEL_EVENTBUSSERVICE_H
3
4#include <map>
5#include <memory>
6#include <string>
7
15
16namespace lintel {
22class EventBusService : public AbstractService<EventBusService>
23{
24private:
25 std::shared_ptr<ProcessName> m_processName;
26 std::shared_ptr<SharedMemoryService> m_sharedMemoryService;
27 std::shared_ptr<SharedMemorySegmentManager> m_segmentManager;
28 std::map<std::string, std::shared_ptr<EventBusEntry>> m_configurationMap;
29 std::map<std::string, EventBus *> m_buses;
30 std::map<std::string, std::size_t> m_generations;
31
35 static std::map<std::string, std::shared_ptr<EventBusEntry>> init(
36 const std::shared_ptr<Configuration> &configuration);
37
42 EventBusConfig configOf(const std::shared_ptr<EventBusEntry> &entry);
43
47 EventBus &resolve(const std::shared_ptr<EventBusEntry> &entry);
48
49public:
55 EventBusService(const std::shared_ptr<Configuration> &configuration,
56 std::shared_ptr<ProcessName> processName,
57 std::shared_ptr<SharedMemoryService> sharedMemoryService,
58 std::shared_ptr<SharedMemorySegmentManager> segmentManager);
59
64 std::shared_ptr<IEventBus> of(const std::string &name);
65
67 void onInitialize() override;
68
69 void onShutdown() override {}
70};
71
72}// namespace lintel
73#endif// LINTEL_EVENTBUSSERVICE_H
Definition AbstractService.h:58
Definition EventBusService.h:23
std::shared_ptr< IEventBus > of(const std::string &name)
void onShutdown() override
Definition EventBusService.h:69
void onInitialize() override
EventBusService(const std::shared_ptr< Configuration > &configuration, std::shared_ptr< ProcessName > processName, std::shared_ptr< SharedMemoryService > sharedMemoryService, std::shared_ptr< SharedMemorySegmentManager > segmentManager)
Definition EventBus.h:73
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9
Definition EventBus.h:31