OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InValuesBitmap.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 InValuesBitmap.h
19  * @author Alex Suhan <alex@mapd.com>
20  *
21  * Copyright (c) 2015 MapD Technologies, Inc. All rights reserved.
22  */
23 
24 #ifndef QUERYENGINE_INVALUESBITMAP_H
25 #define QUERYENGINE_INVALUESBITMAP_H
26 
27 #include "../DataMgr/DataMgr.h"
28 
29 #include <llvm/IR/Value.h>
30 
31 #include <cstdint>
32 #include <stdexcept>
33 #include <vector>
34 
35 class Executor;
36 
37 class FailedToCreateBitmap : public std::runtime_error {
38  public:
39  FailedToCreateBitmap() : std::runtime_error("FailedToCreateBitmap") {}
40 };
41 
43  public:
44  InValuesBitmap(const std::vector<int64_t>& values,
45  const int64_t null_val,
46  const Data_Namespace::MemoryLevel memory_level,
47  const int device_count,
48  Data_Namespace::DataMgr* data_mgr);
50 
51  llvm::Value* codegen(llvm::Value* needle, Executor* executor) const;
52 
53  bool isEmpty() const;
54 
55  bool hasNull() const;
56 
57  private:
58  std::vector<int8_t*> bitsets_;
60  int64_t min_val_;
61  int64_t max_val_;
62  const int64_t null_val_;
64  const int device_count_;
65 };
66 
67 #endif // QUERYENGINE_INVALUESBITMAP_H
Executor(const int db_id, const size_t block_size_x, const size_t grid_size_x, const std::string &debug_dir, const std::string &debug_file,::QueryRenderer::QueryRenderManager *render_manager)
Definition: Execute.cpp:106
bool hasNull() const
std::vector< int8_t * > bitsets_
InValuesBitmap(const std::vector< int64_t > &values, const int64_t null_val, const Data_Namespace::MemoryLevel memory_level, const int device_count, Data_Namespace::DataMgr *data_mgr)
const int64_t null_val_
llvm::Value * codegen(llvm::Value *needle, Executor *executor) const
const int device_count_
bool isEmpty() const
const Data_Namespace::MemoryLevel memory_level_