SObjectizer  5.8
Loading...
Searching...
No Matches
suppress_exceptions.hpp
Go to the documentation of this file.
1/*
2 * SObjectizer-5
3 */
4
5/*!
6 * \since
7 * v.5.6.2
8 *
9 * \file
10 * \brief Helpers for invoking code with suppressing exceptions.
11 */
12
13#pragma once
14
15namespace so_5 {
16
17namespace details {
18
19/*!
20 * @brief Helper function for execution a block of code with
21 * suppression of any exceptions raised inside that block.
22 *
23 * All exceptions are simply intercepted. Nothing is logged in the
24 * case of an exception thrown.
25 *
26 * @since v.5.6.2
27 */
28template< typename Lambda >
29void suppress_exceptions( Lambda && lambda ) noexcept
30{
31 try
32 {
33 lambda();
34 }
35 catch( ... ) {}
36}
37
38} /* namespace details */
39
40} /* namespace so_5 */
An interface of factory for management of worker threads.
An interface for one worker thread.
The standard implementation of abstract_work_thread_factory interface.
abstract_work_thread_t & acquire(so_5::environment_t &) override
Get a new worker thread from factory.
void release(abstract_work_thread_t &thread) noexcept override
Return a worker thread back to the factory.
The standard implementation of abstract_work_thread interface.
void join() override
Stops the current thread until worker thread completes execution of thread_body passed to previous ca...
void start(body_func_t thread_body) override
Start a new thread and execute specified functor on it.
SObjectizer Environment.
#define SO_5_FUNC
Definition declspec.hpp:48
Some reusable and low-level classes/functions which can be used in public header files.
void suppress_exceptions(Lambda &&lambda) noexcept
Helper function for execution a block of code with suppression of any exceptions raised inside that b...
Event dispatchers.
SO_5_FUNC abstract_work_thread_factory_shptr_t make_std_work_thread_factory()
Get a standard SObjectizer's work thread factory that is used by default.
Private part of message limit implementation.
Definition agent.cpp:33