SObjectizer
5.5
|
Base class for representation of one case in multi chain select. More...
#include <mchain_select_ifaces.hpp>
Public Member Functions | |
select_case_t (mchain_t chain) | |
Initialized constructor. More... | |
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 |
select_case_t * | giveout_next () |
void | set_next (select_case_t *next) |
Set the next item in the current queue to which select_case belongs. More... | |
void | notify () SO_5_NOEXCEPT |
Notification for all waiting select_cases. More... | |
void | on_select_finish () SO_5_NOEXCEPT |
Reaction to the end of select work. More... | |
mchain_receive_result_t | try_receive (select_notificator_t ¬ificator) |
An attempt to extract and handle a message from mchain. More... | |
const mchain_t & | chain () const SO_5_NOEXCEPT |
Get the underlying mchain. More... | |
Protected Member Functions | |
virtual mchain_receive_result_t | try_handle_extracted_message (demand_t &demand)=0 |
Attempt to handle extracted message. More... | |
Private Attributes | |
mchain_t | m_chain |
Message chain to receive message from. More... | |
select_notificator_t * | m_notificator = nullptr |
Notificator to be used for notify sleeping thread. More... | |
select_case_t * | m_next = nullptr |
Next select_case in queue. More... | |
Base class for representation of one case in multi chain select.
|
inline |
Initialized constructor.
chain | Message chain for that this select_case is created. |
|
delete |
|
delete |
|
inlinevirtual |
|
inline |
Get the underlying mchain.
|
inline |
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.
|
inline |
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.
|
inline |
Reaction to the end of select work.
|
inline |
Simple access to next item in the current queue to which select_case object belongs at this moment.
|
inline |
Set the next item in the current queue to which select_case belongs.
|
protectedpure virtual |
Attempt to handle extracted message.
This method will be overriden in derived classes.
Implemented in so_5::mchain_props::details::actual_select_case_t< N >.
|
inline |
An attempt to extract and handle a message from mchain.
|
private |
Message chain to receive message from.
|
private |
Next select_case in queue.
A select_case object can be included in one of two different queues:
|
private |
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:
It 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.