|
SObjectizer
5.5
|
Namespaces | |
| anonymous_namespace{enveloped_msg.cpp} | |
| impl | |
Classes | |
| class | envelope_t |
| An interface of envelope with some message/signal inside. More... | |
| class | handler_invoker_t |
| An extended version of handling_context which can be used for calling event handler. More... | |
| class | payload_info_t |
| An information about payload inside envelope. More... | |
Enumerations | |
| enum | access_context_t { access_context_t::handler_found, access_context_t::transformation, access_context_t::inspection } |
| Information about context on that enveloped message is handled. More... | |
Functions | |
| SO_5_NODISCARD SO_5_FUNC optional< payload_info_t > | extract_payload_for_message_transformation ( const message_ref_t &envelope) |
| Helper function for extraction of a payload from enveloped message. More... | |
| SO_5_NODISCARD SO_5_FUNC optional< message_ref_t > | message_to_be_inspected (const message_ref_t &msg_or_envelope) |
| Helper function for extraction of a payload from enveloped message. More... | |
|
strong |
Information about context on that enveloped message is handled.
| SO_5_NODISCARD SO_5_FUNC optional< payload_info_t > so_5::enveloped_msg::extract_payload_for_message_transformation | ( | const message_ref_t & | envelope | ) |
Helper function for extraction of a payload from enveloped message.
Extraction of a payload from an envelope is not an easy task. It is necessary to create an implementation of handler_invoker_t interface and pass it to envelope_t::transformation_hook() method. This implementation should check type of the payload: if it is another envelope then next call to transformation_hook() should be done and so on.
Because of that extraction of the payload from an envelope is a boring task. This helper function preforms all described actions an returns optional with payload inside (if the payload available).
| envelope | Envelope with message inside. |
| SO_5_NODISCARD SO_5_FUNC optional< message_ref_t > so_5::enveloped_msg::message_to_be_inspected | ( | const message_ref_t & | msg_or_envelope | ) |
Helper function for extraction of a payload from enveloped message.
This function checks the kind of msg_or_envelope. If this is an enveloped message message_to_be_inspected() will try to extract the payload and return it. In that case an empty optional object can be returned.
If msg_or_envelope is not an envelope then msg_or_envelope is returned as a result.
1.8.14