SObjectizer  5.8
Loading...
Searching...
No Matches
so_5::mchain_bulk_processing_params_t< Data, Derived > Class Template Reference

Basic parameters for advanced receive from mchain and for multi chain select. More...

#include <mchain.hpp>

Inheritance diagram for so_5::mchain_bulk_processing_params_t< Data, Derived >:
so_5::mchain_props::details::mchain_bulk_processing_basic_params_t< Data >

Public Types

using actual_type = Derived
 
using data_type = Data
 
- Public Types inherited from so_5::mchain_props::details::mchain_bulk_processing_basic_params_t< Data >
using stop_predicate_t
 Type of stop-predicate.
 
using chain_closed_handler_t
 Type of chain-closed event.
 

Public Member Functions

 mchain_bulk_processing_params_t ()=default
 Default constructor.
 
 mchain_bulk_processing_params_t (Data data)
 Initializing constructor.
 
decltype(auto) handle_all () noexcept
 
decltype(auto) extract_n (std::size_t v) noexcept
 Set limit for count of messages to be extracted.
 
decltype(auto) handle_n (std::size_t v) noexcept
 Set limit for count of messages to be handled.
 
template<typename Timeout >
actual_typeempty_timeout (Timeout v) noexcept
 Set timeout for waiting on empty chain.
 
actual_typeno_wait_on_empty () noexcept
 Disable waiting on the empty queue.
 
template<typename Timeout >
actual_typetotal_time (Timeout v) noexcept
 Set total time for the whole receive operation.
 
actual_typestop_on (typename basic_t::stop_predicate_t predicate) noexcept
 Set user condition for stopping receive operation.
 
actual_typeon_close (typename basic_t::chain_closed_handler_t handler) noexcept
 Set handler for chain-closed event.
 
- Public Member Functions inherited from so_5::mchain_props::details::mchain_bulk_processing_basic_params_t< Data >
 mchain_bulk_processing_basic_params_t ()=default
 Default constructor.
 
 mchain_bulk_processing_basic_params_t (Data data)
 Initializing constructor.
 
std::size_t to_extract () const noexcept
 Get limit for count of messages to be extracted.
 
std::size_t to_handle () const noexcept
 Get limit for count of message to be handled.
 
const mchain_props::duration_tempty_timeout () const noexcept
 Get timeout for waiting on empty chain.
 
const mchain_props::duration_ttotal_time () const noexcept
 Get total time for the whole receive operation.
 
const stop_predicate_tstop_on () const noexcept
 Get user condition for stopping receive operation.
 
const chain_closed_handler_tclosed_handler () const noexcept
 Get handler for chain-closed event.
 
const auto & so5_data () const noexcept
 Access to internal data.
 

Protected Member Functions

actual_typeself_reference ()
 
decltype(auto) clone_as_defined () noexcept
 
- Protected Member Functions inherited from so_5::mchain_props::details::mchain_bulk_processing_basic_params_t< Data >
void set_extract_n (std::size_t v) noexcept
 Set limit for count of messages to be extracted.
 
void set_handle_n (std::size_t v) noexcept
 Set limit for count of messages to be handled.
 
void set_empty_timeout (Timeout v) noexcept
 Set timeout for waiting on empty chain.
 
void set_total_time (Timeout v) noexcept
 Set total time for the whole receive operation.
 
void set_stop_on (stop_predicate_t predicate) noexcept
 Set user condition for stopping receive operation.
 
void set_on_close (chain_closed_handler_t handler) noexcept
 Set handler for chain-closed event.
 

Private Types

using basic_t
 

Detailed Description

template<typename Data, typename Derived>
class so_5::mchain_bulk_processing_params_t< Data, Derived >

Basic parameters for advanced receive from mchain and for multi chain select.

Since
v.5.5.16

Definition at line 1268 of file mchain.hpp.

Member Typedef Documentation

◆ actual_type

template<typename Data , typename Derived >
using so_5::mchain_bulk_processing_params_t< Data, Derived >::actual_type = Derived

Definition at line 1275 of file mchain.hpp.

◆ basic_t

template<typename Data , typename Derived >
using so_5::mchain_bulk_processing_params_t< Data, Derived >::basic_t
private
Initial value:
mchain_props::details::mchain_bulk_processing_basic_params_t<Data>

Definition at line 1271 of file mchain.hpp.

◆ data_type

template<typename Data , typename Derived >
using so_5::mchain_bulk_processing_params_t< Data, Derived >::data_type = Data

Definition at line 1277 of file mchain.hpp.

Constructor & Destructor Documentation

◆ mchain_bulk_processing_params_t() [1/2]

template<typename Data , typename Derived >
so_5::mchain_bulk_processing_params_t< Data, Derived >::mchain_bulk_processing_params_t ( )
default

Default constructor.

◆ mchain_bulk_processing_params_t() [2/2]

template<typename Data , typename Derived >
so_5::mchain_bulk_processing_params_t< Data, Derived >::mchain_bulk_processing_params_t ( Data data)
inline

Initializing constructor.

Definition at line 1299 of file mchain.hpp.

Member Function Documentation

◆ clone_as_defined()

template<typename Data , typename Derived >
decltype(auto) so_5::mchain_bulk_processing_params_t< Data, Derived >::clone_as_defined ( )
inlineprotectednoexcept

Helper method to make a clone with msg_count_status_t::defined status.

Definition at line 1288 of file mchain.hpp.

◆ empty_timeout()

template<typename Data , typename Derived >
template<typename Timeout >
actual_type & so_5::mchain_bulk_processing_params_t< Data, Derived >::empty_timeout ( Timeout v)
inlinenoexcept

Set timeout for waiting on empty chain.

Note
This value will be ignored if total_time() is also used to set total receive time.
Argument v can be of type duration_t or so_5::infinite_wait or so_5::no_wait.

Definition at line 1364 of file mchain.hpp.

◆ extract_n()

template<typename Data , typename Derived >
decltype(auto) so_5::mchain_bulk_processing_params_t< Data, Derived >::extract_n ( std::size_t v)
inlinenoexcept

Set limit for count of messages to be extracted.

When extract_n() is used then receive() will be finished after extraction of the specified number of message.

Usage example:

decltype(auto) extract_n(std::size_t v) noexcept
Set limit for count of messages to be extracted.
Definition mchain.hpp:1331
mchain_receive_params_t< mchain_props::msg_count_status_t::undefined > from(mchain_t chain)
A helper function for simplification of creation of mchain_receive_params instance.
Definition mchain.hpp:1595
mchain_receive_result_t receive(const mchain_receive_params_t< Msg_Count_Status > &params, Handlers &&... handlers)
Advanced version of receive from mchain.
Definition mchain.hpp:1883

Definition at line 1331 of file mchain.hpp.

◆ handle_all()

template<typename Data , typename Derived >
decltype(auto) so_5::mchain_bulk_processing_params_t< Data, Derived >::handle_all ( )
inlinenoexcept

A directive to handle all messages until chain will be closed or receiving will be stopped manually.

Usage example:

Since
v.5.6.0

Definition at line 1314 of file mchain.hpp.

◆ handle_n()

template<typename Data , typename Derived >
decltype(auto) so_5::mchain_bulk_processing_params_t< Data, Derived >::handle_n ( std::size_t v)
inlinenoexcept

Set limit for count of messages to be handled.

When handled_n() is used then receive() will be finished after handling of the specified number of message.

Usage example:

decltype(auto) handle_n(std::size_t v) noexcept
Set limit for count of messages to be handled.
Definition mchain.hpp:1348

Definition at line 1348 of file mchain.hpp.

◆ no_wait_on_empty()

template<typename Data , typename Derived >
actual_type & so_5::mchain_bulk_processing_params_t< Data, Derived >::no_wait_on_empty ( )
inlinenoexcept

Disable waiting on the empty queue.

Usage example:
so_5::mchain_t ch = env.create_mchain(...);
actual_type & no_wait_on_empty() noexcept
Disable waiting on the empty queue.
Definition mchain.hpp:1387
Note
It is just a shorthand for:
receive( from(chain).empty_timeout(std::chrono::seconds(0)), ...);
const mchain_props::duration_t & empty_timeout() const noexcept
Definition mchain.hpp:1229

Definition at line 1387 of file mchain.hpp.

◆ on_close()

template<typename Data , typename Derived >
actual_type & so_5::mchain_bulk_processing_params_t< Data, Derived >::on_close ( typename basic_t::chain_closed_handler_t handler)
inlinenoexcept

Set handler for chain-closed event.

If there is a previously set handler the old handler will be lost.

Usage example:

...
// Stop reading channels when any of channels is closed.
bool some_ch_closed = false;
.on_close([&some_ch_closed](const so_5::mchain_t &) {
some_ch_closed = true;
})
.stop_on([&some_ch_closed]{ return some_ch_closed; }),
receive_case(ch1, ...)
receive_case(ch2, ...)
...);
actual_type & on_close(typename basic_t::chain_closed_handler_t handler) noexcept
Set handler for chain-closed event.
Definition mchain.hpp:1448
mchain_t create_mchain(environment_t &env)
Create size-unlimited chain.
mchain_select_params_t< mchain_props::msg_count_status_t::undefined > from_all()
Helper function for creation of mchain_select_params instance with default values.
mchain_select_result_t select(const mchain_select_params_t< Msg_Count_Status > &params, Cases &&... cases)
An advanced form of multi chain select.
mchain_props::select_case_unique_ptr_t receive_case(mchain_t chain, Handlers &&... handlers)
A helper for creation of select_case object for one multi chain select.
Since
v.5.5.17

Definition at line 1448 of file mchain.hpp.

◆ self_reference()

template<typename Data , typename Derived >
actual_type & so_5::mchain_bulk_processing_params_t< Data, Derived >::self_reference ( )
inlineprotected

Helper method to get a reference to itself but with a type of the derived class.

Definition at line 1283 of file mchain.hpp.

◆ stop_on()

template<typename Data , typename Derived >
actual_type & so_5::mchain_bulk_processing_params_t< Data, Derived >::stop_on ( typename basic_t::stop_predicate_t predicate)
inlinenoexcept

Set user condition for stopping receive operation.

Note
predicate should return true if receive must be stopped.

Definition at line 1414 of file mchain.hpp.

◆ total_time()

template<typename Data , typename Derived >
template<typename Timeout >
actual_type & so_5::mchain_bulk_processing_params_t< Data, Derived >::total_time ( Timeout v)
inlinenoexcept

Set total time for the whole receive operation.

Note
Argument v can be of type duration_t or so_5::infinite_wait or so_5::no_wait.

Definition at line 1400 of file mchain.hpp.


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