OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
types.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, Inc.
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 
17 /*
18  * File: types.h
19  * Author(s): steve@map-d.com
20  *
21  * Created on June 19, 2014, 4:29 PM
22  */
23 
24 #ifndef _TYPES_H
25 #define _TYPES_H
26 
27 #include <sstream>
28 #include <string>
29 #include <thread>
30 #include <vector>
31 
32 // The ChunkKey is a unique identifier for chunks in the database file.
33 // The first element of the underlying vector for ChunkKey indicates the type of
34 // ChunkKey (also referred to as the keyspace id)
35 using ChunkKey = std::vector<int>;
36 
37 inline std::string showChunk(const ChunkKey& key) {
38  std::ostringstream tss;
39  for (auto vecIt = key.begin(); vecIt != key.end(); ++vecIt) {
40  tss << *vecIt << ",";
41  }
42  return tss.str();
43 }
44 
45 #endif /* _TYPES_H */
std::vector< int > ChunkKey
Definition: types.h:35
std::string showChunk(const ChunkKey &key)
Definition: types.h:37