REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
msg::handlers::DynamicRegistry Class Reference

The Message Registry holds the list of all known message types. More...

#include <registry.h>

Inheritance diagram for msg::handlers::DynamicRegistry:
Collaboration diagram for msg::handlers::DynamicRegistry:

Public Member Functions

MessageHandlerlookup (const std::string &msg_type)
 Returns nullptr if not found.
 
net::auth::SecurityLevel requiredClearance (const std::string &msg_type)
 
bool set (const std::string &msg_type, MessageHandler *handler, net::auth::SecurityLevel minimumClearance)
 
bool set (const std::string &msg_type, int result_code_prefix, MessageHandler *handler, net::auth::SecurityLevel minimumClearance)
 
void dump ()
 
void write_handler_names_to (JsonArray &target)
 for structured output
 
void init (carrier::Carrier &c)
 Actual registration of all handlers in code.
 

Additional Inherited Members

- Static Public Member Functions inherited from utils::HeapSingleton< DynamicRegistry >
static DynamicRegistry & get ()
 

Detailed Description

The Message Registry holds the list of all known message types.

The DynamicRegistry implementation uses an heap-allocated std::map as well as Handlers which can be null pointers.

Definition at line 30 of file registry.h.

Member Function Documentation

◆ dump()

FLASHMEM void msg::handlers::DynamicRegistry::dump ( )

Definition at line 117 of file registry.cpp.

◆ init()

FLASHMEM void msg::handlers::DynamicRegistry::init ( carrier::Carrier & c)

Actual registration of all handlers in code.

Definition at line 23 of file registry.cpp.

References set().

◆ lookup()

FLASHMEM msg::handlers::MessageHandler * msg::handlers::DynamicRegistry::lookup ( const std::string & msg_type)

Returns nullptr if not found.

Definition at line 77 of file registry.cpp.

◆ requiredClearance()

FLASHMEM net::auth::SecurityLevel msg::handlers::DynamicRegistry::requiredClearance ( const std::string & msg_type)

Definition at line 87 of file registry.cpp.

References net::auth::RequiresNothing.

◆ set() [1/2]

FLASHMEM bool msg::handlers::DynamicRegistry::set ( const std::string & msg_type,
int result_code_prefix,
MessageHandler * handler,
net::auth::SecurityLevel minimumClearance )

Definition at line 103 of file registry.cpp.

References msg::handlers::MessageHandler::result_prefix.

◆ set() [2/2]

FLASHMEM bool msg::handlers::DynamicRegistry::set ( const std::string & msg_type,
MessageHandler * handler,
net::auth::SecurityLevel minimumClearance )

Definition at line 97 of file registry.cpp.

Referenced by init().

◆ write_handler_names_to()

FLASHMEM void msg::handlers::DynamicRegistry::write_handler_names_to ( JsonArray & target)

for structured output

Definition at line 136 of file registry.cpp.


The documentation for this class was generated from the following files: