OmniSciDB  a7179b2938
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResultSetBuilder.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, 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 
25 #ifndef QUERYENGINE_RESULTSETBUILDER_H
26 #define QUERYENGINE_RESULTSETBUILDER_H
27 
28 #include "RelAlgDagBuilder.h"
29 #include "ResultSet.h"
30 
31 // ********************************************************
32 // * Usage
33 //
34 // SomeClass* cls;
35 // ResultSetSomeClassBuilder builder(cls);
36 // // builder ... further config as requried
37 // ResultSet* set = builder.build();
38 //
39 // ********************************************************
40 
42  protected:
43  ResultSet* makeResultSet(const std::vector<TargetInfo>& targets,
44  const ExecutorDeviceType device_type,
46  const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner,
47  const Executor* executor);
48 
49  public:
50  virtual ResultSet* build() = 0;
51 };
52 
54  private:
56  const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner;
57 
58  public:
60  const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner);
61 
62  ResultSet* build();
63 };
64 
66  private:
68  const std::vector<TargetInfo>& targets;
71  const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner;
72  const Executor* executor;
73 
74  public:
76  const std::vector<TargetInfo>& targets,
78  const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner);
79 
82  const std::vector<TargetInfo>& targets,
85  const std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner,
86  const Executor* executor);
87 
88  ResultSet* build();
89 };
90 
91 #endif // QUERYENGINE_RESULTSETBUILDER_H
ExecutorDeviceType
const std::vector< TargetInfo > & targets
virtual ResultSet * build()=0
ResultSet * makeResultSet(const std::vector< TargetInfo > &targets, const ExecutorDeviceType device_type, const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const Executor *executor)
const ExecutorDeviceType device_type
const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner
const QueryMemoryDescriptor & query_mem_desc
ResultSetDefaultBuilder(const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner)
const RelLogicalValues * logical_values
ResultSetLogicalValuesBuilder(const std::vector< TargetInfo > &targets, const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner)
Basic constructors and methods of the row set interface.
const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner
const QueryMemoryDescriptor & query_mem_desc