00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00048 #ifndef COMSTL_INCL_COMSTL_FUNCTIONAL_HPP_COM_PREDICATE_ADAPTORS
00049 #define COMSTL_INCL_COMSTL_FUNCTIONAL_HPP_COM_PREDICATE_ADAPTORS
00050
00051 #ifndef COMSTL_DOCUMENTATION_SKIP_SECTION
00052 # define COMSTL_VER_COMSTL_FUNCTIONAL_HPP_COM_PREDICATE_ADAPTORS_MAJOR 1
00053 # define COMSTL_VER_COMSTL_FUNCTIONAL_HPP_COM_PREDICATE_ADAPTORS_MINOR 0
00054 # define COMSTL_VER_COMSTL_FUNCTIONAL_HPP_COM_PREDICATE_ADAPTORS_REVISION 2
00055 # define COMSTL_VER_COMSTL_FUNCTIONAL_HPP_COM_PREDICATE_ADAPTORS_EDIT 5
00056 #endif
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 #ifndef COMSTL_INCL_COMSTL_H_STLSOFT
00067 # include <comstl/comstl.h>
00068 #endif
00069
00070 #ifndef STLSOFT_INCL_FUNCTIONAL
00071 # define STLSOFT_INCL_FUNCTIONAL
00072 # include <functional>
00073 #endif
00074
00075
00076
00077
00078
00079 #ifndef _COMSTL_NO_NAMESPACE
00080 # if defined(_STLSOFT_NO_NAMESPACE) || \
00081 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00082
00083 namespace comstl
00084 {
00085 # else
00086
00087
00088 namespace stlsoft
00089 {
00090
00091 namespace comstl_project
00092 {
00093
00094 # endif
00095 #endif
00096
00097
00098
00099
00100
00107
00108 template <ss_typename_param_k A0>
00109 struct com_SUCCEEDED_tester_1_stdcall
00110 : public stlsoft_ns_qual_std(unary_function)<A0, bool>
00111 {
00112 public:
00113 typedef bool return_type;
00114 typedef A0 argument_type;
00115 typedef HRESULT (STLSOFT_STDCALL* function_type)(argument_type);
00116 public:
00117 ss_explicit_k com_SUCCEEDED_tester_1_stdcall(function_type func)
00118 : m_func(func)
00119 {}
00120 return_type operator ()(argument_type a) const
00121 {
00122 return SUCCEEDED((*m_func)(a));
00123 }
00124 private:
00125 function_type m_func;
00126 };
00127
00134
00135 template< ss_typename_param_k A0
00136 , ss_typename_param_k A1
00137 >
00138 struct com_SUCCEEDED_tester_2_stdcall
00139 : public stlsoft_ns_qual_std(binary_function)<A0, A1, bool>
00140 {
00141 public:
00142 typedef bool return_type;
00143 typedef A0 first_argument_type;
00144 typedef A1 second_argument_type;
00145 typedef HRESULT (STLSOFT_STDCALL* function_type)(first_argument_type, second_argument_type);
00146 public:
00147 ss_explicit_k com_SUCCEEDED_tester_2_stdcall(function_type func)
00148 : m_func(func)
00149 {}
00150 return_type operator ()(first_argument_type a0, second_argument_type a1) const
00151 {
00152 return SUCCEEDED((*m_func)(a0, a1));
00153 }
00154
00155 private:
00156 function_type m_func;
00157 };
00158
00159
00166
00167 template <ss_typename_param_k A0>
00168 struct com_S_OK_tester_1_stdcall
00169 : public stlsoft_ns_qual_std(unary_function)<A0, bool>
00170 {
00171 public:
00172 typedef bool return_type;
00173 typedef A0 argument_type;
00174 typedef HRESULT (STLSOFT_STDCALL* function_type)(argument_type);
00175 public:
00176 ss_explicit_k com_S_OK_tester_1_stdcall(function_type func)
00177 : m_func(func)
00178 {}
00179 return_type operator ()(argument_type a) const
00180 {
00181 return S_OK == (*m_func)(a);
00182 }
00183 private:
00184 function_type m_func;
00185 };
00186
00193
00194 template< ss_typename_param_k A0
00195 , ss_typename_param_k A1
00196 >
00197 struct com_S_OK_tester_2_stdcall
00198 : public stlsoft_ns_qual_std(binary_function)<A0, A1, bool>
00199 {
00200 public:
00201 typedef bool return_type;
00202 typedef A0 first_argument_type;
00203 typedef A1 second_argument_type;
00204 typedef HRESULT (STLSOFT_STDCALL* function_type)(first_argument_type, second_argument_type);
00205 public:
00206 ss_explicit_k com_S_OK_tester_2_stdcall(function_type func)
00207 : m_func(func)
00208 {}
00209 return_type operator ()(first_argument_type a0, second_argument_type a1) const
00210 {
00211 return S_OK == (*m_func)(a0, a1);
00212 }
00213
00214 private:
00215 function_type m_func;
00216 };
00217
00224
00225 template <ss_typename_param_k A0>
00226 struct com_SUCCEEDED_tester_1_cdecl
00227 : public stlsoft_ns_qual_std(unary_function)<A0, bool>
00228 {
00229 public:
00230 typedef bool return_type;
00231 typedef A0 argument_type;
00232 typedef HRESULT (STLSOFT_CDECL* function_type)(argument_type);
00233 public:
00234 ss_explicit_k com_SUCCEEDED_tester_1_cdecl(function_type func)
00235 : m_func(func)
00236 {}
00237 return_type operator ()(argument_type a) const
00238 {
00239 return SUCCEEDED((*m_func)(a));
00240 }
00241 private:
00242 function_type m_func;
00243 };
00244
00251
00252 template< ss_typename_param_k A0
00253 , ss_typename_param_k A1
00254 >
00255 struct com_SUCCEEDED_tester_2_cdecl
00256 : public stlsoft_ns_qual_std(binary_function)<A0, A1, bool>
00257 {
00258 public:
00259 typedef bool return_type;
00260 typedef A0 first_argument_type;
00261 typedef A1 second_argument_type;
00262 typedef HRESULT (STLSOFT_CDECL* function_type)(first_argument_type, second_argument_type);
00263 public:
00264 ss_explicit_k com_SUCCEEDED_tester_2_cdecl(function_type func)
00265 : m_func(func)
00266 {}
00267 return_type operator ()(first_argument_type a0, second_argument_type a1) const
00268 {
00269 return SUCCEEDED((*m_func)(a0, a1));
00270 }
00271
00272 private:
00273 function_type m_func;
00274 };
00275
00276
00283
00284 template <ss_typename_param_k A0>
00285 struct com_S_OK_tester_1_cdecl
00286 : public stlsoft_ns_qual_std(unary_function)<A0, bool>
00287 {
00288 public:
00289 typedef bool return_type;
00290 typedef A0 argument_type;
00291 typedef HRESULT (STLSOFT_CDECL* function_type)(argument_type);
00292 public:
00293 ss_explicit_k com_S_OK_tester_1_cdecl(function_type func)
00294 : m_func(func)
00295 {}
00296 return_type operator ()(argument_type a) const
00297 {
00298 return S_OK == (*m_func)(a);
00299 }
00300 private:
00301 function_type m_func;
00302 };
00303
00310
00311 template< ss_typename_param_k A0
00312 , ss_typename_param_k A1
00313 >
00314 struct com_S_OK_tester_2_cdecl
00315 : public stlsoft_ns_qual_std(binary_function)<A0, A1, bool>
00316 {
00317 public:
00318 typedef bool return_type;
00319 typedef A0 first_argument_type;
00320 typedef A1 second_argument_type;
00321 typedef HRESULT (STLSOFT_CDECL* function_type)(first_argument_type, second_argument_type);
00322 public:
00323 ss_explicit_k com_S_OK_tester_2_cdecl(function_type func)
00324 : m_func(func)
00325 {}
00326 return_type operator ()(first_argument_type a0, second_argument_type a1) const
00327 {
00328 return S_OK == (*m_func)(a0, a1);
00329 }
00330
00331 private:
00332 function_type m_func;
00333 };
00334
00335
00336
00337
00338
00345 template <ss_typename_param_k A0>
00346 inline com_SUCCEEDED_tester_1_stdcall<A0> com_SUCCEEDED(HRESULT (STLSOFT_STDCALL *pfn)(A0))
00347 {
00348 return com_SUCCEEDED_tester_1_stdcall<A0>(pfn);
00349 }
00350
00357 template <ss_typename_param_k A0>
00358 inline com_SUCCEEDED_tester_1_cdecl<A0> com_SUCCEEDED(HRESULT (STLSOFT_CDECL *pfn)(A0))
00359 {
00360 return com_SUCCEEDED_tester_1_cdecl<A0>(pfn);
00361 }
00362
00369 template< ss_typename_param_k A0
00370 , ss_typename_param_k A1
00371 >
00372 inline com_SUCCEEDED_tester_2_stdcall<A0, A1> com_SUCCEEDED(HRESULT (STLSOFT_STDCALL *pfn)(A0, A1))
00373 {
00374 return com_SUCCEEDED_tester_2_stdcall<A0, A1>(pfn);
00375 }
00376
00383 template< ss_typename_param_k A0
00384 , ss_typename_param_k A1
00385 >
00386 inline com_SUCCEEDED_tester_2_cdecl<A0, A1> com_SUCCEEDED(HRESULT (STLSOFT_CDECL *pfn)(A0, A1))
00387 {
00388 return com_SUCCEEDED_tester_2_cdecl<A0, A1>(pfn);
00389 }
00390
00397 template <ss_typename_param_k A0>
00398 inline com_S_OK_tester_1_stdcall<A0> com_S_OK(HRESULT (STLSOFT_STDCALL *pfn)(A0))
00399 {
00400 return com_S_OK_tester_1_stdcall<A0>(pfn);
00401 }
00402
00409 template <ss_typename_param_k A0>
00410 inline com_S_OK_tester_1_cdecl<A0> com_S_OK(HRESULT (STLSOFT_CDECL *pfn)(A0))
00411 {
00412 return com_S_OK_tester_1_cdecl<A0>(pfn);
00413 }
00414
00421 template< ss_typename_param_k A0
00422 , ss_typename_param_k A1
00423 >
00424 inline com_S_OK_tester_2_stdcall<A0, A1> com_S_OK(HRESULT (STLSOFT_STDCALL *pfn)(A0, A1))
00425 {
00426 return com_S_OK_tester_2_stdcall<A0, A1>(pfn);
00427 }
00428
00435 template< ss_typename_param_k A0
00436 , ss_typename_param_k A1
00437 >
00438 inline com_S_OK_tester_2_cdecl<A0, A1> com_S_OK(HRESULT (STLSOFT_CDECL *pfn)(A0, A1))
00439 {
00440 return com_S_OK_tester_2_cdecl<A0, A1>(pfn);
00441 }
00442
00443
00444
00445 #ifndef _COMSTL_NO_NAMESPACE
00446 # if defined(_STLSOFT_NO_NAMESPACE) || \
00447 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00448 }
00449 # else
00450 }
00451 }
00452 # endif
00453 #endif
00454
00455
00456
00457 #endif
00458
00459