OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
42  std::shared_ptr<std::mutex> string_dict_mutex;
44  const std::string& name,
45  int nbits,
46  bool shared,
47  const int rc,
48  std::string& fname,
49  bool temp)
50  : dictRef(dict_ref)
51  , dictName(name)
52  , dictNBits(nbits)
53  , dictIsShared(shared)
54  , dictFolderPath(fname)
55  , refcount(rc)
56  , dictIsTemp(temp)
57  , stringDict(nullptr)
58  , string_dict_mutex(std::make_shared<std::mutex>()) {}
59 
60  DictDescriptor(int db_id,
61  int dict_id,
62  const std::string& name,
63  int nbits,
64  bool shared,
65  const int rc,
66  std::string& fname,
67  bool temp)
68  : dictName(name)
69  , dictNBits(nbits)
70  , dictIsShared(shared)
71  , dictFolderPath(fname)
72  , refcount(rc)
73  , dictIsTemp(temp)
74  , stringDict(nullptr)
75  , string_dict_mutex(std::make_shared<std::mutex>()) {
76  dictRef.dbId = db_id;
77  dictRef.dictId = dict_id;
78  }
79 };
80 
81 #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< std::mutex > string_dict_mutex
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.