xref: /openbmc/bmcweb/features/redfish/include/registries_selector.hpp (revision fb54610544f97b989b549d8fc94518e2d38c9467)
18dab0f58SEd Tanous #pragma once
28dab0f58SEd Tanous #include "registries/base_message_registry.hpp"
3*fb546105SMyung Bae #include "registries/heartbeat_event_message_registry.hpp"
48dab0f58SEd Tanous #include "registries/openbmc_message_registry.hpp"
58dab0f58SEd Tanous #include "registries/task_event_message_registry.hpp"
68dab0f58SEd Tanous 
78dab0f58SEd Tanous #include <span>
88dab0f58SEd Tanous #include <string_view>
98dab0f58SEd Tanous 
108dab0f58SEd Tanous namespace redfish::registries
118dab0f58SEd Tanous {
128dab0f58SEd Tanous inline std::span<const MessageEntry>
138dab0f58SEd Tanous     getRegistryFromPrefix(std::string_view registryName)
148dab0f58SEd Tanous {
158dab0f58SEd Tanous     if (task_event::header.registryPrefix == registryName)
168dab0f58SEd Tanous     {
178dab0f58SEd Tanous         return {task_event::registry};
188dab0f58SEd Tanous     }
198dab0f58SEd Tanous     if (openbmc::header.registryPrefix == registryName)
208dab0f58SEd Tanous     {
218dab0f58SEd Tanous         return {openbmc::registry};
228dab0f58SEd Tanous     }
23*fb546105SMyung Bae     if (heartbeat_event::header.registryPrefix == registryName)
24*fb546105SMyung Bae     {
25*fb546105SMyung Bae         return {heartbeat_event::registry};
26*fb546105SMyung Bae     }
278dab0f58SEd Tanous     if (base::header.registryPrefix == registryName)
288dab0f58SEd Tanous     {
298dab0f58SEd Tanous         return {base::registry};
308dab0f58SEd Tanous     }
318dab0f58SEd Tanous     return {openbmc::registry};
328dab0f58SEd Tanous }
338dab0f58SEd Tanous } // namespace redfish::registries
34