20 #ifndef INCLUDED_VCL_THREADEX_HXX
21 #define INCLUDED_VCL_THREADEX_HXX
23 #include <osl/conditn.hxx>
44 virtual void doIt() = 0;
48 namespace solarthread {
53 template <
typename FuncT,
typename ResultT>
57 static ResultT
exec( FuncT
const& func )
60 ::std::unique_ptr<ExecutorT>
const pExecutor(
new ExecutorT(func) );
63 std::rethrow_exception(pExecutor->m_exc);
64 return *pExecutor->m_result;
71 virtual void doIt()
override
77 m_exc = std::current_exception();
92 template <
typename FuncT>
96 static void exec( FuncT
const& func )
99 ::std::unique_ptr<ExecutorT>
const pExecutor(
new ExecutorT(func) );
100 pExecutor->execute();
101 if (pExecutor->m_exc)
102 std::rethrow_exception(pExecutor->m_exc);
115 m_exc = std::current_exception();
162 template <
typename FuncT>
166 FuncT, decltype(func())>::exec(func);
172 #endif // INCLUDED_VCL_THREADEX_HXX
::std::optional< ResultT > m_result
static ResultT exec(FuncT const &func)
GenericSolarThreadExecutor(FuncT const &func)
GenericSolarThreadExecutor(FuncT const &func)
static void exec(FuncT const &func)
virtual void doIt() override
auto syncExecute(FuncT const &func) -> decltype(func())
This function will execute the passed functor synchronously in the solar thread, thus the calling thr...
virtual void doIt() override
#define DECL_DLLPRIVATE_LINK(Member, ArgType, RetType)