16 #ifndef STXXL_COMPLETION_HANDLER_HEADER
17 #define STXXL_COMPLETION_HANDLER_HEADER
19 #include <stxxl/bits/namespace.h>
20 #include <stxxl/bits/compat_unique_ptr.h>
23 __STXXL_BEGIN_NAMESPACE
27 class completion_handler_impl
30 virtual void operator () (
request *) = 0;
31 virtual completion_handler_impl * clone()
const = 0;
32 virtual ~completion_handler_impl() { }
35 template <
typename handler_type>
36 class completion_handler1 :
public completion_handler_impl
39 handler_type handler_;
42 completion_handler1(
const handler_type & handler__) : handler_(handler__) { }
43 completion_handler1 * clone()
const
45 return new completion_handler1(*
this);
47 void operator () (
request * req)
65 compat_unique_ptr<completion_handler_impl>::result sp_impl_;
69 sp_impl_(static_cast<completion_handler_impl *>(0))
73 sp_impl_(obj.sp_impl_.get()->clone())
76 template <
typename handler_type>
78 sp_impl_(
new completion_handler1<handler_type>(handler__))
83 sp_impl_.reset(obj.sp_impl_.get()->clone());
86 void operator () (
request * req)
100 __STXXL_END_NAMESPACE
102 #endif // !STXXL_COMPLETION_HANDLER_HEADER
Default completion handler class.
Definition: completion_handler.h:94
Request with basic properties like file and offset.
Definition: request.h:39
Completion handler class (Loki-style)
Definition: completion_handler.h:63
void operator()(request *)
An operator that does nothing.
Definition: completion_handler.h:97