ReactOS 0.4.15-dev-7958-gcd0bb1a
fadapter.h
Go to the documentation of this file.
1#ifndef _fadapter_h_
2#define _fadapter_h_
3
4#include <functional>
5
6// used as adaptor's return/argument type,
7// to allow binders/composers usage
8struct __void_tag {};
9
10#if !defined (STLPORT) || defined (_STLP_USE_NAMESPACES)
11using std::unary_function;
12#endif
13
14template <class Result>
16protected:
17 Result (*ptr)();
18public:
19 explicit pointer_to_void_function(Result (*x)()) : ptr(x) {}
20 Result operator()() const { return ptr(); }
21 Result operator()(__void_tag) const { return ptr(); }
22};
23
24// to feed composers
25template <class Arg1>
26struct projectvoid : public unary_function<Arg1,__void_tag> {
27 __void_tag operator()(const Arg1& x) const { return __void_tag(); }
28};
29
30#if !defined (_STLP_MEMBER_POINTER_PARAM_BUG)
31
32template <class Result>
35}
36
37// alternate name
38template <class Result>
41}
42
43#endif /* !defined (_STLP_MEMBER_POINTER_PARAM_BUG) */
44
45template <class Arg>
46class pointer_to_unary_procedure /* :public unary_function<Arg, __void_tag> */ {
47protected:
48 typedef void (*fun_type)(Arg);
50public:
51 typedef Arg argument_type;
54 void operator() (Arg x) const { ptr(x); }
55};
56
57template <class Arg>
60}
61
62template <class Arg1, class Arg2>
63class pointer_to_binary_procedure /* : public unary_function<Arg1, Arg2, __void_tag> */ {
64protected:
65 typedef void (*fun_type)(Arg1, Arg2);
67public:
68 typedef Arg1 first_argument_type;
72 void operator() (Arg1 x, Arg2 y) const { ptr(x, y); }
73};
74
75template <class Arg1, class Arg2>
78}
79
80#endif
void operator()(Arg1 x, Arg2 y) const
Definition: fadapter.h:72
void(* fun_type)(Arg1, Arg2)
Definition: fadapter.h:65
pointer_to_binary_procedure(fun_type x)
Definition: fadapter.h:71
void operator()(Arg x) const
Definition: fadapter.h:54
pointer_to_unary_procedure(fun_type x)
Definition: fadapter.h:53
void(* fun_type)(Arg)
Definition: fadapter.h:48
pointer_to_void_function(Result(*x)())
Definition: fadapter.h:19
Result operator()() const
Definition: fadapter.h:20
Result operator()(__void_tag) const
Definition: fadapter.h:21
pointer_to_unary_procedure< Arg > ptr_proc(void(*x)(Arg))
Definition: fadapter.h:58
pointer_to_void_function< Result > ptr_fun(Result(*x)())
Definition: fadapter.h:33
pointer_to_void_function< Result > ptr_gen(Result(*x)())
Definition: fadapter.h:39
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
__void_tag operator()(const Arg1 &x) const
Definition: fadapter.h:27
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409