OmniSciDB  5ade3759e0
DictDescriptor.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 #ifndef DICT_DESCRIPTOR_H
18 #define DICT_DESCRIPTOR_H
19 
20 #include <cassert>
21 #include <memory>
22 #include <string>
23 
24 #include "../Shared/sqltypes.h"
25 #include "../StringDictionary/StringDictionary.h"
26 
35  std::string dictName;
36  int dictNBits;
38  std::string dictFolderPath;
39  int refcount;
40  bool dictIsTemp;
41  std::shared_ptr<StringDictionary> stringDict;
43  const std::string& name,
44  int nbits,
45  bool shared,
46  const int rc,
47  std::string& fname,
48  bool temp)
49  : dictRef(dict_ref)
50  , dictName(name)
51  , dictNBits(nbits)
52  , dictIsShared(shared)
53  , dictFolderPath(fname)
54  , refcount(rc)
55  , dictIsTemp(temp)
56  , stringDict(nullptr) {}
57 
58  DictDescriptor(int db_id,
59  int dict_id,
60  const std::string& name,
61  int nbits,
62  bool shared,
63  const int rc,
64  std::string& fname,
65  bool temp)
66  : dictName(name)
67  , dictNBits(nbits)
68  , dictIsShared(shared)
69  , dictFolderPath(fname)
70  , refcount(rc)
71  , dictIsTemp(temp)
72  , stringDict(nullptr) {
73  dictRef.dbId = db_id;
74  dictRef.dictId = dict_id;
75  }
76 };
77 
78 #endif // DICT_DESCRIPTOR
std::string dictFolderPath
DictDescriptor(int db_id, int dict_id, const std::string &name, int nbits, bool shared, const int rc, std::string &fname, bool temp)
std::shared_ptr< StringDictionary > stringDict
std::string dictName
DictDescriptor(DictRef dict_ref, const std::string &name, int nbits, bool shared, const int rc, std::string &fname, bool temp)
int32_t dictId
Definition: DictRef.h:10
int32_t dbId
Definition: DictRef.h:9
Descriptor for a dictionary for a string columne.