closure.hpp

Go to the documentation of this file.
00001 /****
00002 ***** Copyright 2010 Intel Corporation All Rights Reserved.
00003 *****
00004 ***** The source code, information and material contained herein are owned by Intel Corporation or its suppliers  *****
00005 ***** or licensors, and title to such Material remains with Intel Corporation or its suppliers or licensors.      *****
00006 ***** The Material contains proprietary information of Intel or its suppliers and licensors. The Material is      *****
00007 ***** protected by worldwide copyright laws and treaty provisions. No part of the Material may be used, copied,   *****
00008 ***** reproduced, modified, published, uploaded, posted, transmitted, distributed or disclosed in any way without *****
00009 ***** Intel's prior express written permission.
00010 *****
00011 ***** No license under any patent, copyright or other intellectual property rights in the material is granted to  *****
00012 ***** or conferred upon you, either expressly, by implication, inducement, estoppel or otherwise. Any license     *****
00013 ***** under such intellectual property rights must be express and approved by Intel in writing.
00014 ****/
00015 
00016 /**** Copyright Ends ****/
00017 
00018 #ifndef ARBB_CPP_CLOSURE_HPP
00019 #define ARBB_CPP_CLOSURE_HPP
00020 
00021 #include "namespace.hpp"
00022 #include "detail/collectors.hpp"
00023 #include "detail/type_traits.hpp"
00024 
00025 namespace ARBB_CPP_NS {
00026 
00027 #ifdef ARBB_CPP_DOXYGEN_ONLY
00028 
00029 
00030 
00038 template <typename FunctionType>
00039 class closure<FunctionType> {
00040 public:
00042   closure();
00043 
00045   closure(const closure& other);
00046 
00052   closure(const auto_closure& other);
00053 
00068   void operator()(FunctionParams... arguments) const;
00069 
00071   bool empty() const;
00072 
00074   closure& operator=(const closure& other);
00075 
00081   closure& operator=(const auto_closure& other);
00082 
00084   bool operator==(const auto_closure& other);
00085 
00087   bool operator!=(const auto_closure& other);
00088 
00090   bool operator==(const closure& other);
00091 
00093   bool operator!=(const closure& other);
00094 
00096   operator auto_closure() const
00097   {
00098     return auto_closure::create<argument_types>(m_function, m_wrapper_function);
00099   }
00100 };
00101 
00103 #endif
00104 
00106 
00107 // Primary template for closure specializations
00108 template <typename T>
00109 class closure {};
00110 
00112 
00113 } // namespace ARBB_CPP_NS
00114 
00115 #include "detail/closure_base.hpp"
00116 
00117 #define ARBB_CLOSURE_NUM_ARGS 0
00118 #include "detail/closure_template.hpp"
00119 #undef ARBB_CLOSURE_NUM_ARGS
00120 #define ARBB_CLOSURE_NUM_ARGS 1
00121 #include "detail/closure_template.hpp"
00122 #undef ARBB_CLOSURE_NUM_ARGS
00123 #define ARBB_CLOSURE_NUM_ARGS 2
00124 #include "detail/closure_template.hpp"
00125 #undef ARBB_CLOSURE_NUM_ARGS
00126 #define ARBB_CLOSURE_NUM_ARGS 3
00127 #include "detail/closure_template.hpp"
00128 #undef ARBB_CLOSURE_NUM_ARGS
00129 #define ARBB_CLOSURE_NUM_ARGS 4
00130 #include "detail/closure_template.hpp"
00131 #undef ARBB_CLOSURE_NUM_ARGS
00132 #define ARBB_CLOSURE_NUM_ARGS 5
00133 #include "detail/closure_template.hpp"
00134 #undef ARBB_CLOSURE_NUM_ARGS
00135 #define ARBB_CLOSURE_NUM_ARGS 6
00136 #include "detail/closure_template.hpp"
00137 #undef ARBB_CLOSURE_NUM_ARGS
00138 #define ARBB_CLOSURE_NUM_ARGS 7
00139 #include "detail/closure_template.hpp"
00140 #undef ARBB_CLOSURE_NUM_ARGS
00141 #define ARBB_CLOSURE_NUM_ARGS 8
00142 #include "detail/closure_template.hpp"
00143 #undef ARBB_CLOSURE_NUM_ARGS
00144 #define ARBB_CLOSURE_NUM_ARGS 9
00145 #include "detail/closure_template.hpp"
00146 #undef ARBB_CLOSURE_NUM_ARGS
00147 #define ARBB_CLOSURE_NUM_ARGS 10
00148 #include "detail/closure_template.hpp"
00149 #undef ARBB_CLOSURE_NUM_ARGS
00150 #define ARBB_CLOSURE_NUM_ARGS 11
00151 #include "detail/closure_template.hpp"
00152 #undef ARBB_CLOSURE_NUM_ARGS
00153 #define ARBB_CLOSURE_NUM_ARGS 12
00154 #include "detail/closure_template.hpp"
00155 #undef ARBB_CLOSURE_NUM_ARGS
00156 #define ARBB_CLOSURE_NUM_ARGS 13
00157 #include "detail/closure_template.hpp"
00158 #undef ARBB_CLOSURE_NUM_ARGS
00159 #define ARBB_CLOSURE_NUM_ARGS 14
00160 #include "detail/closure_template.hpp"
00161 #undef ARBB_CLOSURE_NUM_ARGS
00162 #define ARBB_CLOSURE_NUM_ARGS 15
00163 #include "detail/closure_template.hpp"
00164 #undef ARBB_CLOSURE_NUM_ARGS
00165 #define ARBB_CLOSURE_NUM_ARGS 16
00166 #include "detail/closure_template.hpp"
00167 #undef ARBB_CLOSURE_NUM_ARGS
00168 #define ARBB_CLOSURE_NUM_ARGS 17
00169 #include "detail/closure_template.hpp"
00170 #undef ARBB_CLOSURE_NUM_ARGS
00171 #define ARBB_CLOSURE_NUM_ARGS 18
00172 #include "detail/closure_template.hpp"
00173 #undef ARBB_CLOSURE_NUM_ARGS
00174 #define ARBB_CLOSURE_NUM_ARGS 19
00175 #include "detail/closure_template.hpp"
00176 #undef ARBB_CLOSURE_NUM_ARGS
00177 #define ARBB_CLOSURE_NUM_ARGS 20
00178 #include "detail/closure_template.hpp"
00179 #undef ARBB_CLOSURE_NUM_ARGS
00180 #define ARBB_CLOSURE_NUM_ARGS 21
00181 #include "detail/closure_template.hpp"
00182 #undef ARBB_CLOSURE_NUM_ARGS
00183 #define ARBB_CLOSURE_NUM_ARGS 22
00184 #include "detail/closure_template.hpp"
00185 #undef ARBB_CLOSURE_NUM_ARGS
00186 #define ARBB_CLOSURE_NUM_ARGS 23
00187 #include "detail/closure_template.hpp"
00188 #undef ARBB_CLOSURE_NUM_ARGS
00189 #define ARBB_CLOSURE_NUM_ARGS 24
00190 #include "detail/closure_template.hpp"
00191 #undef ARBB_CLOSURE_NUM_ARGS
00192 #define ARBB_CLOSURE_NUM_ARGS 25
00193 #include "detail/closure_template.hpp"
00194 #undef ARBB_CLOSURE_NUM_ARGS
00195 #define ARBB_CLOSURE_NUM_ARGS 26
00196 #include "detail/closure_template.hpp"
00197 #undef ARBB_CLOSURE_NUM_ARGS
00198 #define ARBB_CLOSURE_NUM_ARGS 27
00199 #include "detail/closure_template.hpp"
00200 #undef ARBB_CLOSURE_NUM_ARGS
00201 #define ARBB_CLOSURE_NUM_ARGS 28
00202 #include "detail/closure_template.hpp"
00203 #undef ARBB_CLOSURE_NUM_ARGS
00204 #define ARBB_CLOSURE_NUM_ARGS 29
00205 #include "detail/closure_template.hpp"
00206 #undef ARBB_CLOSURE_NUM_ARGS
00207 #define ARBB_CLOSURE_NUM_ARGS 30
00208 #include "detail/closure_template.hpp"
00209 #undef ARBB_CLOSURE_NUM_ARGS
00210 #define ARBB_CLOSURE_NUM_ARGS 31
00211 #include "detail/closure_template.hpp"
00212 #undef ARBB_CLOSURE_NUM_ARGS
00213 #define ARBB_CLOSURE_NUM_ARGS 32
00214 #include "detail/closure_template.hpp"
00215 #undef ARBB_CLOSURE_NUM_ARGS
00216 #define ARBB_CLOSURE_NUM_ARGS 33
00217 #include "detail/closure_template.hpp"
00218 #undef ARBB_CLOSURE_NUM_ARGS
00219 #define ARBB_CLOSURE_NUM_ARGS 34
00220 #include "detail/closure_template.hpp"
00221 #undef ARBB_CLOSURE_NUM_ARGS
00222 #define ARBB_CLOSURE_NUM_ARGS 35
00223 #include "detail/closure_template.hpp"
00224 #undef ARBB_CLOSURE_NUM_ARGS
00225 
00226 #endif // ARBB_CPP_CLOSURE_HPP

Submit feedback on this help topic

Copyright © 2010, Intel Corporation. All rights reserved.