|
SObjectizer 5.8
|
Some reusable and low-level classes/functions which can be used in public header files. More...
Namespaces | |
| namespace | agent_method_pointer_details |
| namespace | anonymous_namespace{handler_makers.cpp} |
| namespace | event_subscription_helpers |
| Various helpers for event subscription. | |
| namespace | ios_helpers |
| Helpers for manipulation with standard C++ I/O streams. | |
| namespace | lambda_traits |
| Helper templates for detection of lambda-type traits. | |
| namespace | message_holder_details |
| namespace | rollback_on_exception_details |
| Implementation details for implementation of rollback on exception helper. | |
| namespace | scope_exit_details |
Typedefs | |
| template<typename Msg > | |
| using | actual_mhood_base_type |
| Just a useful typename for base type of mhood implementation. | |
Enumerations | |
| enum class | mhood_type_t { classical_message , classical_signal , user_type_message } |
| A special selector for mhood_t implementations. More... | |
| enum class | method_arity { nullary , unary } |
| A special enumeration to specify arity of lambda-function or method. More... | |
Functions | |
| template<typename L > | |
| void | abort_on_fatal_error (L logging_lambda) noexcept |
| template<typename Msg , typename... Args> | |
| auto | make_message_instance (Args &&... args) -> std::unique_ptr< typename message_payload_type< Msg >::envelope_type > |
| A helper for allocate instance of a message. | |
| template<typename Main_Action , typename Rollback_Action > | |
| auto | do_with_rollback_on_exception (Main_Action main_action, Rollback_Action rollback_action) -> decltype(main_action()) |
| Helper function for do some action with rollback in the case of an exception. | |
| template<typename Lambda > | |
| void | suppress_exceptions (Lambda &&lambda) noexcept |
| Helper function for execution a block of code with suppression of any exceptions raised inside that block. | |
| template<typename L > | |
| scope_exit_details::at_exit_t< L > | at_scope_exit (L &&l) |
| Helper function for creation action to be performed at scope exit. | |
| template<typename Bunch > | |
| void | fill_handlers_bunch (Bunch &bunch, std::size_t) |
| template<typename Bunch , typename... Others> | |
| void | fill_handlers_bunch (Bunch &bunch, std::size_t index, msg_type_and_handler_pair_t &&handler, Others &&... other_handlers) |
| template<typename Bunch , typename Lambda , typename... Others> | |
| void | fill_handlers_bunch (Bunch &bunch, std::size_t index, Lambda &&lambda, Others &&... other_handlers) |
| template<typename L > | |
| auto | invoke_noexcept_code (L lambda) noexcept -> decltype(lambda()) |
| template<typename Predicate > | |
| bool | wait_for_big_interval (std::unique_lock< std::mutex > &lock, std::condition_variable &cv, std::chrono::steady_clock::duration timeout, Predicate pred) |
| Helper function for safe call of condition_variable::wait_for with possible big timeouts. | |
Some reusable and low-level classes/functions which can be used in public header files.
Some low-level implemetation details which can be used in public header files.
| using so_5::details::actual_mhood_base_type |
|
strong |
A special enumeration to specify arity of lambda-function or method.
This enumeration is intended to be used in utility tools like is_agent_method_pointer class.
| Enumerator | |
|---|---|
| nullary | Method or function has no arguments. |
| unary | Method or function has just one argument. |
Definition at line 78 of file message_handler_format_detector.hpp.
|
strong |
A special selector for mhood_t implementations.
| Enumerator | |
|---|---|
| classical_message | Message type is a classical message derived from so_5::message_t. |
| classical_signal | Message type is a classical signal derived from so_5::signal_t. |
| user_type_message | Message type is not related to so_5::message_t. |
|
noexcept |
Definition at line 53 of file abort_on_fatal_error.hpp.
| scope_exit_details::at_exit_t< L > so_5::details::at_scope_exit | ( | L && | l | ) |
Helper function for creation action to be performed at scope exit.
Usage example:
Definition at line 60 of file at_scope_exit.hpp.
| auto so_5::details::do_with_rollback_on_exception | ( | Main_Action | main_action, |
| Rollback_Action | rollback_action ) -> decltype(main_action()) |
Helper function for do some action with rollback in the case of an exception.
| Main_Action | type of lambda with main action. |
| Rollback_Action | type of lambda with rollback action. |
Definition at line 85 of file rollback_on_exception.hpp.
| void so_5::details::fill_handlers_bunch | ( | Bunch & | bunch, |
| std::size_t | index, | ||
| Lambda && | lambda, | ||
| Others &&... | other_handlers ) |
| bunch | What to fill. |
| index | An index for next handler. |
| lambda | Next handler to be inserted. |
| other_handlers | All other handlers. |
Definition at line 583 of file handler_makers.hpp.
| void so_5::details::fill_handlers_bunch | ( | Bunch & | bunch, |
| std::size_t | index, | ||
| msg_type_and_handler_pair_t && | handler, | ||
| Others &&... | other_handlers ) |
| bunch | What to fill. |
| index | An index for next handler. |
| handler | Next handler to be inserted. |
| other_handlers | All other handlers. |
Definition at line 566 of file handler_makers.hpp.
| void so_5::details::fill_handlers_bunch | ( | Bunch & | bunch, |
| std::size_t | ) |
Definition at line 559 of file handler_makers.hpp.
|
noexcept |
Definition at line 30 of file invoke_noexcept_code.hpp.
|
nodiscard |
A helper for allocate instance of a message.
Definition at line 841 of file message.hpp.
|
noexcept |
Helper function for execution a block of code with suppression of any exceptions raised inside that block.
All exceptions are simply intercepted. Nothing is logged in the case of an exception thrown.
Definition at line 29 of file suppress_exceptions.hpp.
| bool so_5::details::wait_for_big_interval | ( | std::unique_lock< std::mutex > & | lock, |
| std::condition_variable & | cv, | ||
| std::chrono::steady_clock::duration | timeout, | ||
| Predicate | pred ) |
Helper function for safe call of condition_variable::wait_for with possible big timeouts.
In some places of SObjectizer's code big values of wait-time can be used for std::condition_variable::wait_for. For example, that values can be produced by so_5::infinite_wait_special_timevalue() function.
If such big value will be passed to std::condition_variable::wait_for the wait_for can return immediately without any waiting.
To avoid that behavior this helper function should be used instead of the direct call to condition_variable::wait_for.
Definition at line 44 of file safe_cv_wait_for.hpp.