SObjectizer 5.8
|
Base class for representation of one case in multi chain select. More...
#include <mchain_select_ifaces.hpp>
Public Types | |
using | handling_result_t |
The result of attempt of handling this case. | |
Public Member Functions | |
select_case_t (mchain_t chain) | |
Initialized constructor. | |
select_case_t (const select_case_t &)=delete | |
select_case_t (select_case_t &&)=delete | |
virtual | ~select_case_t () |
select_case_t * | query_next () const noexcept |
select_case_t * | giveout_next () noexcept |
void | set_next (select_case_t *next) noexcept |
Set the next item in the current queue to which select_case belongs. | |
void | notify () noexcept |
Notification for all waiting select_cases. | |
void | on_select_finish () noexcept |
Reaction to the end of select work. | |
virtual handling_result_t | try_handle (select_notificator_t ¬ificator)=0 |
An attempt to handle this case. | |
const mchain_t & | chain () const noexcept |
Get the underlying mchain. | |
Protected Member Functions | |
auto | extract (demand_t &demand) |
Helper method for calling extract method of the target mchain. | |
auto | push (const std::type_index &msg_type, const message_ref_t &message) |
Helper method for calling push method of the target mchain. | |
Protected Attributes | |
mchain_t | m_chain |
Message chain to receive message from. | |
select_notificator_t * | m_notificator = nullptr |
Notificator to be used for notify sleeping thread. | |
select_case_t * | m_next = nullptr |
Next select_case in queue. | |
Base class for representation of one case in multi chain select.
Definition at line 64 of file mchain_select_ifaces.hpp.
The result of attempt of handling this case.
Definition at line 149 of file mchain_select_ifaces.hpp.
|
inline |
Initialized constructor.
chain | Message chain for that this select_case is created. |
Definition at line 154 of file mchain_select_ifaces.hpp.
|
delete |
|
delete |
|
inlinevirtual |
Definition at line 163 of file mchain_select_ifaces.hpp.
|
inlinenodiscardnoexcept |
|
inlinenodiscardprotected |
Helper method for calling extract method of the target mchain.
This method is intended to be called by a derived class. This helper is necessary because only select_case_t class is declared as friend for abstract_message_chain_t class. Classes that are derived from select_case_t are not friends for abstract_message_chain_t class and can't call protected/private methods of abstract_message_chain_t.
Definition at line 118 of file mchain_select_ifaces.hpp.
|
inlinenodiscardnoexcept |
Get the next item in the current queue to which select_case belongs at this moment and drop this pointer to nullptr value.
This method must be used if select_case object must be extracted from the current queue.
Definition at line 187 of file mchain_select_ifaces.hpp.
|
inlinenoexcept |
Notification for all waiting select_cases.
This method is called by mchain if empty mchain becomes non-empty or if it is closed.
This method does notification for all members of select_case queue. It means that mchain calls notify() for the head of the queue and that head does notification for all other queue's members.
Definition at line 214 of file mchain_select_ifaces.hpp.
|
inlinenoexcept |
Reaction to the end of select work.
Definition at line 237 of file mchain_select_ifaces.hpp.
|
inlinenodiscardprotected |
Helper method for calling push method of the target mchain.
This method is intended to be called by a derived class. This helper is necessary because only select_case_t class is declared as friend for abstract_message_chain_t class. Classes that are derived from select_case_t are not friends for abstract_message_chain_t class and can't call protected/private methods of abstract_message_chain_t.
msg_type | Type of message/signal to be pushed. |
message | Message/signal to be pushed. |
Definition at line 138 of file mchain_select_ifaces.hpp.
|
inlinenodiscardnoexcept |
Simple access to next item in the current queue to which select_case object belongs at this moment.
Definition at line 172 of file mchain_select_ifaces.hpp.
|
inlinenoexcept |
Set the next item in the current queue to which select_case belongs.
Definition at line 199 of file mchain_select_ifaces.hpp.
|
nodiscardpure virtual |
An attempt to handle this case.
Implemented in so_5::mchain_props::details::receive_select_case_t, and so_5::mchain_props::details::send_select_case_t.
|
protected |
Message chain to receive message from.
Definition at line 68 of file mchain_select_ifaces.hpp.
|
protected |
Next select_case in queue.
A select_case object can be included in one of two different queues:
Definition at line 101 of file mchain_select_ifaces.hpp.
|
protected |
Notificator to be used for notify sleeping thread.
Can be null. It means that select_case is not used in select queue for the mchain at that moment.
There are just two methods where m_notificator changes its value:
In the previous versions of SObjectizer m_notificator received nullptr value during notification of new messages arrival or closing of mchain. But this lead to data races and the behaviour was changed. Now m_notificator can hold an actual pointer even after notification was initiated.
Definition at line 89 of file mchain_select_ifaces.hpp.