QuantumLibrary
quantum_functions.h
1 /*
2 ** Copyright 2018 Bloomberg Finance L.P.
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 #ifndef BLOOMBERG_QUANTUM_FUNCTIONS_H
17 #define BLOOMBERG_QUANTUM_FUNCTIONS_H
18 
19 #include <functional>
20 #include <vector>
21 #include <iterator>
22 
23 namespace Bloomberg {
24 namespace quantum {
25 
26 //==============================================================================================
27 // struct Functions
28 //==============================================================================================
31 struct Functions
32 {
33  template <class RET, class INPUT_IT>
34  using ForEachFunc = std::function<RET(const typename std::iterator_traits<INPUT_IT>::value_type&)>;
35 
36  template <class KEY, class MAPPED_TYPE, class INPUT_IT>
37  using MapFunc = std::function<std::vector<std::pair<KEY, MAPPED_TYPE>>(const typename std::iterator_traits<INPUT_IT>::value_type&)>;
38 
39  template <class KEY, class MAPPED_TYPE, class REDUCED_TYPE>
40  using ReduceFunc = std::function<std::pair<KEY, REDUCED_TYPE>(std::pair<KEY, std::vector<MAPPED_TYPE>>&&)>;
41 };
42 
43 }}
44 
45 #endif //BLOOMBERG_QUANTUM_FUNCTIONS_H
Definition: quantum_buffer_impl.h:22
std::function< RET(const typename std::iterator_traits< INPUT_IT >::value_type &)> ForEachFunc
Definition: quantum_functions.h:34
std::function< std::vector< std::pair< KEY, MAPPED_TYPE > >(const typename std::iterator_traits< INPUT_IT >::value_type &)> MapFunc
Definition: quantum_functions.h:37
std::function< std::pair< KEY, REDUCED_TYPE >(std::pair< KEY, std::vector< MAPPED_TYPE > > &&)> ReduceFunc
Definition: quantum_functions.h:40
Contains typedefs for various functions.
Definition: quantum_functions.h:31