SObjectizer  5.5
Public Types | Public Member Functions | Protected Member Functions | Private Types | List of all members
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 = typename Data ::stop_predicate_t
 Type of stop-predicate. More...
 
using chain_closed_handler_t = typename Data ::chain_closed_handler_t
 Type of chain-closed event. More...
 

Public Member Functions

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

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. More...
 
void set_handle_n (std::size_t v) noexcept
 Set limit for count of messages to be handled. More...
 
void set_empty_timeout (Timeout v) noexcept
 Set timeout for waiting on empty chain. More...
 
void set_total_time (Timeout v) noexcept
 Set total time for the whole receive operation. More...
 
void set_stop_on (stop_predicate_t predicate) noexcept
 Set user condition for stopping receive operation. More...
 
void set_on_close (chain_closed_handler_t handler) noexcept
 Set handler for chain-closed event. More...
 

Private Types

using basic_t = mchain_props::details::mchain_bulk_processing_basic_params_t< Data >
 

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

Member Typedef Documentation

◆ actual_type

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

◆ basic_t

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

◆ data_type

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

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.

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.

◆ 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.

◆ 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:

◆ 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

◆ 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:

◆ 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:
Note
It is just a shorthand for:
receive( from(chain).empty_timeout(std::chrono::seconds(0)), ...);

◆ 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; }),
case_(ch1, ...)
case_(ch2, ...)
...);
Since
v.5.5.17

◆ 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.

◆ 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.

◆ 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.

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