SObjectizer  5.7
Public Types | Public Member Functions | Private Member Functions | List of all members
so_5::enveloped_msg::envelope_t Class Referenceabstract

An interface of envelope with some message/signal inside. More...

#include <enveloped_msg.hpp>

Inheritance diagram for so_5::enveloped_msg::envelope_t:
so_5::message_t so_5::atomic_refcounted_t so_5::experimental::testing::v1::impl::special_envelope_t

Public Types

using payload_info_t = ::so_5::enveloped_msg::payload_info_t
 
using handler_invoker_t = ::so_5::enveloped_msg::handler_invoker_t
 
using access_context_t = ::so_5::enveloped_msg::access_context_t
 
- Public Types inherited from so_5::message_t
using kind_t = ::so_5::message_kind_t
 A short typedef for kind of message. More...
 

Public Member Functions

 envelope_t ()=default
 
 envelope_t (const envelope_t &)=default
 
envelope_toperator= (const envelope_t &)=default
 
 envelope_t (envelope_t &&)=default
 
envelope_toperator= (envelope_t &&)=default
 
virtual ~envelope_t () override=default
 
virtual void access_hook (access_context_t context, handler_invoker_t &invoker) noexcept=0
 
- Public Member Functions inherited from so_5::message_t
 message_t ()
 
 message_t (const message_t &other)
 
 message_t (message_t &&other)
 
message_toperator= (const message_t &other)
 
message_toperator= (message_t &&other)
 
virtual ~message_t () noexcept=default
 
- Public Member Functions inherited from so_5::atomic_refcounted_t
 atomic_refcounted_t (const atomic_refcounted_t &)=delete
 
atomic_refcounted_toperator= (const atomic_refcounted_t &)=delete
 
 atomic_refcounted_t () noexcept
 Default constructor. More...
 
 ~atomic_refcounted_t () noexcept=default
 Destructor. More...
 
void inc_ref_count () noexcept
 Increments reference count. More...
 
unsigned long dec_ref_count () noexcept
 Decrement reference count. More...
 

Private Member Functions

kind_t so5_message_kind () const noexcept override
 Detect the kind of the message. More...
 

Detailed Description

An interface of envelope with some message/signal inside.

SObjectizer v.5.5.23 introduced a new thing: enveloped messages. It means that actual message/signal is placed into a special container called 'envelope'. This envelope is delivered to all receivers of the original message/signal. But before the calling of event handler in a receiver the original message/signal (e.g. payload) are extracted from envelope and passed to the event handler.

This interface describes 'envelope' for such containers. All envelopes should implement this interface.

Method access_hook() is called by SObjectizer when the payload of enveloped message should be accessed. For example:

When access_hook() is called the envelope should check the availability of the payload and, if the payload is available for processing, should pass the payload info to handler_invoker_t::invoke() method.

Please note that call of handler_invoker_t::invoke() is not guaranteed. Envelope can check some conditions (like payload expiration or revocation) and does call to invoke() only if these conditions are meet. But if some conditions are not fulfilled then access_hook() won't call handler_invoker_t::invoke() method.

Since
v.5.5.23

Member Typedef Documentation

◆ access_context_t

◆ handler_invoker_t

◆ payload_info_t

Constructor & Destructor Documentation

◆ envelope_t() [1/3]

so_5::enveloped_msg::envelope_t::envelope_t ( )
default

◆ envelope_t() [2/3]

so_5::enveloped_msg::envelope_t::envelope_t ( const envelope_t )
default

◆ envelope_t() [3/3]

so_5::enveloped_msg::envelope_t::envelope_t ( envelope_t &&  )
default

◆ ~envelope_t()

virtual so_5::enveloped_msg::envelope_t::~envelope_t ( )
overridevirtualdefault

Member Function Documentation

◆ access_hook()

virtual void so_5::enveloped_msg::envelope_t::access_hook ( access_context_t  context,
handler_invoker_t invoker 
)
pure virtualnoexcept
Parameters
contextWhy this hook is called.
invokerProxy object which can call an actual event handler.

Implemented in so_5::experimental::testing::v1::impl::special_envelope_t.

◆ operator=() [1/2]

envelope_t& so_5::enveloped_msg::envelope_t::operator= ( const envelope_t )
default

◆ operator=() [2/2]

envelope_t& so_5::enveloped_msg::envelope_t::operator= ( envelope_t &&  )
default

◆ so5_message_kind()

kind_t so_5::enveloped_msg::envelope_t::so5_message_kind ( ) const
inlineoverrideprivatevirtualnoexcept

Detect the kind of the message.

Note
This method is intended to be used by SObjectizer and low-level SObjectizer extension. Because of that it is not guaranteed that this method is part of stable SObjectizer API. It can be changed or even removed in any future versions of SObjectizer.
Since
v.5.5.23

Reimplemented from so_5::message_t.


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