libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG > Class Template Referencefinal

The wrapper for the input work that the user wishes to have mutated. More...

#include <thread_work_closure.hpp>

Inheritance diagram for jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >:
[legend]
Collaboration diagram for jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >:
[legend]

Public Types

typedef closure_base< CFG > base_t
 
typedef base_t::cfg_type cfg_type
 
typedef base_t::cfg_details_type cfg_details_type
 
typedef void result_type
 The result-type of the mutation, to assist in making the derived types look like a std::unary_function. More...
 
typedef InpWk argument_type
 The argument-type of the mutation, to assist in making the derived types look like a std::unary_function. More...
 
- Public Types inherited from jmmcg::ppd::private_::closure::closure_base< CFG >
typedef CFG cfg_type
 
typedef cfg_type::template add_cfg_details< closure_basecfg_details_type
 

Public Member Functions

__stdcall closure_void_static (argument_type &&i, typename cfg_details_type::params const &p) noexcept(false) FORCE_INLINE
 
 ~closure_void_static () noexcept(true) FORCE_INLINE
 
bool __fastcall operator== (const closure_void_static &) const noexcept(true) FORCE_INLINE
 
bool __fastcall operator< (const closure_void_static &) const noexcept(true) FORCE_INLINE
 
const argument_type &__fastcall input () const noexcept(true) FORCE_INLINE
 
argument_type &__fastcall input () noexcept(true) FORCE_INLINE
 
void __fastcall process () FORCE_INLINE
 Process the wrapped work. More...
 
- Public Member Functions inherited from jmmcg::ppd::private_::closure::closure_base< CFG >
constexpr int response_time () const noexcept(true) FORCE_INLINE
 This function could be overridden in the user's work class to provide an indication of the time it would take to process the transferred closure_base-derived closure. This would only make sense if the pool_aspect was instantiated with a trait of pool_traits::prioritised_queue, and the closure_base-derived closure has the correct operator<() declared for it. More...
 
void update_edge (typename cfg_type::node_property_t::value_type const e_details) noexcept(false) FORCE_INLINE
 
void delete_edge () noexcept(false) FORCE_INLINE
 
void checkpoint_cfg () noexcept(false) FORCE_INLINE
 
const cfg_type::vertex_t vertex () const noexcept(true) FORCE_INLINE
 

Friends

tostream &__fastcall operator<< (tostream &os, closure_void_static const &w) noexcept(false)
 

Additional Inherited Members

- Protected Member Functions inherited from jmmcg::ppd::private_::closure::closure_base< CFG >
 closure_base (typename cfg_details_type::params const &p) noexcept(noexcept(cfg_details_type(std::declval< typename cfg_details_type::params >()))) FORCE_INLINE
 
virtual ~closure_base () noexcept(true) FORCE_INLINE
 

Detailed Description

template<class InpWk, bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept), class CFG>
class jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >

The wrapper for the input work that the user wishes to have mutated.

The input work to be transferred must be:

  • copy-constructible or move-constructible,
  • may have a member typedef of result_type for declaring the result of the mutation and
  • the mutation function may be specified with either
    • a member function "void __fastcall process(result_type &) noexcept(false)" or,
    • a member function "void __fastcall process(result_type &) const noexcept(false)".
See also
thread_wk_base, control_flow_graph, no_control_flow_graph

Definition at line 162 of file thread_work_closure.hpp.

Member Typedef Documentation

◆ argument_type

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
typedef InpWk jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::argument_type

The argument-type of the mutation, to assist in making the derived types look like a std::unary_function.

Definition at line 168 of file thread_work_closure.hpp.

◆ base_t

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
typedef closure_base<CFG> jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::base_t

Definition at line 164 of file thread_work_closure.hpp.

◆ cfg_details_type

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
typedef base_t::cfg_details_type jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::cfg_details_type

Definition at line 166 of file thread_work_closure.hpp.

◆ cfg_type

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
typedef base_t::cfg_type jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::cfg_type

Definition at line 165 of file thread_work_closure.hpp.

◆ result_type

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
typedef void jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::result_type

The result-type of the mutation, to assist in making the derived types look like a std::unary_function.

Definition at line 167 of file thread_work_closure.hpp.

Constructor & Destructor Documentation

◆ closure_void_static()

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
__stdcall jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::closure_void_static ( argument_type &&  i,
typename cfg_details_type::params const &  p 
)
inlinenoexcept

◆ ~closure_void_static()

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::~closure_void_static ( )
inlinenoexcept

Definition at line 171 of file thread_work_closure.hpp.

Member Function Documentation

◆ input() [1/2]

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
const closure_void_static< InpWk, NoExcept, Proc, CFG >::argument_type &__fastcall jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::input ( ) const
inlinenoexcept

Definition at line 113 of file thread_work_closure_impl.hpp.

◆ input() [2/2]

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
closure_void_static< InpWk, NoExcept, Proc, CFG >::argument_type &__fastcall jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::input ( )
inlinenoexcept

Definition at line 119 of file thread_work_closure_impl.hpp.

◆ operator<()

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
bool __fastcall jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::operator< ( const closure_void_static< InpWk, NoExcept,, CFG > &  tw) const
inlinenoexcept

◆ operator==()

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
bool __fastcall jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::operator== ( const closure_void_static< InpWk, NoExcept,, CFG > &  tw) const
inlinenoexcept

◆ process()

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
void __fastcall jmmcg::ppd::private_::closure::closure_void_static< InpWk, NoExcept,, CFG >::process ( )
inline

Process the wrapped work.

By default, all exceptions derived from std::exception are caught and wrapped, to be potentially transferred to the client. Also a "catch-all" block traps any other unknown exceptions, that are also potentially transferred. It is a grave programmatic error to allow a thread_pool with un-emitted exceptions to execute it's destructor. To avoid this potential for undefined behaviour, if process()ing the closure_void_static is likely to result in an exception being thrown, the user should capture the result of the transfer in an execution_context and dereference it, when the exception will be safely re-thrown, and the user will have an opportunity to correctly catch it and deal with it.

Todo:
We really want to compute the noexcept() from the Proc member fn. typedef typename std::remove_pointer<process_ptr_t>::type process_t; - This doesn't seem to remove the pointer. BOOST_MPL_ASSERT((std::is_same<process_t, int>));
See also
thread_wrapper, thread_pool, thread_pool_type

Definition at line 128 of file thread_work_closure_impl.hpp.

References jmmcg::ppd::private_::closure::thread_wk< generic_traits::return_data::nonjoinable, OST, ThrW, WFlg, Del, AtCtr, CFG >::thread_wk().

Friends And Related Function Documentation

◆ operator<<

template<class InpWk , bool NoExcept, void(__fastcall InpWk::*)() noexcept Proc(NoExcept) , class CFG >
tostream& __fastcall operator<< ( tostream os,
closure_void_static< InpWk, NoExcept,, CFG > const &  w 
)
friend
Todo:
Implement using the advice given in "Standard C++ IOStreams and Locales" by A.Langer & K.Kreft, page 170.

Definition at line 194 of file thread_work_closure.hpp.


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