SDSL 3.0.2
Succinct Data Structure Library
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// Copyright (c) 2016, the SDSL Project Authors. All rights reserved.
2// Please see the AUTHORS file for details. Use of this source code is governed
3// by a BSD license that can be found in the LICENSE file.
4#ifndef SDSL_CONFIG
5#define SDSL_CONFIG
6
7#include <map>
8#include <stdint.h>
9#include <string>
10
11#ifndef MSVC_COMPILER
12# define SDSL_UNUSED __attribute__((unused))
13#else
14# define SDSL_UNUSED
15#endif
16
17namespace sdsl
18{
19
20// forward declarations
21namespace util
22{
23template <typename T>
24std::string to_string(T const & t, int w = 1);
25uint64_t pid();
26uint64_t id();
27} // namespace util
28
29namespace conf // namespace for library constant
30{
31// size of the buffer for reading and writing data in elements (not in bytes)
32const uint64_t SDSL_BLOCK_SIZE = (uint64_t)1 << 22;
33
34constexpr char KEY_BWT[] = "bwt";
35constexpr char KEY_BWT_INT[] = "bwt_int";
36constexpr char KEY_SA[] = "sa";
37constexpr char KEY_CSA[] = "csa";
38constexpr char KEY_CST[] = "cst";
39constexpr char KEY_ISA[] = "isa";
40constexpr char KEY_TEXT[] = "text";
41constexpr char KEY_TEXT_INT[] = "text_int";
42constexpr char KEY_PSI[] = "psi";
43constexpr char KEY_LCP[] = "lcp";
44constexpr char KEY_SAMPLE_CHAR[] = "sample_char";
45} // namespace conf
46
47typedef uint64_t int_vector_size_type;
48
49typedef std::map<std::string, std::string> tMSS;
50
57
63
66{
67 bool delete_files; // Flag which indicates if all files which were created
68 bool delete_data; // Flag which indicates if the original data can be deleted
69 // during construction should be deleted.
70 std::string dir; // Directory for temporary files.
71 std::string id; // Identifier is part of temporary file names. If
72 // id is the empty string, then it will be replace
73 // a concatenation of PID and a unique ID inside the
74 // current process.
75 tMSS file_map; // Files stored during the construction process.
76 cache_config(bool f_delete_files = true,
77 std::string f_dir = "./",
78 std::string f_id = "",
79 tMSS f_file_map = tMSS()) :
80 delete_files(f_delete_files),
81 delete_data(false),
82 dir(f_dir),
83 id(f_id),
84 file_map(f_file_map)
85 {
86 if ("" == id)
87 {
89 }
90 }
91};
92
94template <uint8_t width, typename T = void>
96{
97 static char const * KEY_TEXT;
98};
99
100template <typename T>
102{
103 static char const * KEY_TEXT;
104};
105
106template <typename T>
108{
109 static char const * KEY_TEXT;
110};
111
113template <uint8_t width, typename T = void>
115{
116 static char const * KEY_BWT;
117};
118
119template <typename T>
121{
122 static char const * KEY_BWT;
123};
124
125template <typename T>
127{
128 static char const * KEY_BWT;
129};
130
131template <typename T>
133
134template <typename T>
136
137template <typename T>
139
140template <typename T>
142
143template <uint8_t width>
145
146template <uint8_t width>
148
149} // namespace sdsl
150
151#endif
constexpr char KEY_CSA[]
Definition config.hpp:37
constexpr char KEY_SAMPLE_CHAR[]
Definition config.hpp:44
constexpr char KEY_SA[]
Definition config.hpp:36
constexpr char KEY_CST[]
Definition config.hpp:38
const uint64_t SDSL_BLOCK_SIZE
Definition config.hpp:32
constexpr char KEY_BWT_INT[]
Definition config.hpp:35
constexpr char KEY_TEXT[]
Definition config.hpp:40
constexpr char KEY_LCP[]
Definition config.hpp:43
constexpr char KEY_TEXT_INT[]
Definition config.hpp:41
constexpr char KEY_PSI[]
Definition config.hpp:42
constexpr char KEY_ISA[]
Definition config.hpp:39
constexpr char KEY_BWT[]
Definition config.hpp:34
uint64_t id()
uint64_t pid()
std::string to_string(T const &t, int w=1)
Namespace for the succinct data structure library.
std::map< std::string, std::string > tMSS
Definition config.hpp:49
byte_sa_algo_type
Definition config.hpp:59
@ LIBDIVSUFSORT
Definition config.hpp:60
@ SE_SAIS
Definition config.hpp:61
uint64_t int_vector_size_type
Definition config.hpp:47
format_type
Definition config.hpp:52
@ JSON_FORMAT
Definition config.hpp:53
@ R_FORMAT
Definition config.hpp:54
@ HTML_FORMAT
Definition config.hpp:55
Helper class for construction process.
Definition config.hpp:66
cache_config(bool f_delete_files=true, std::string f_dir="./", std::string f_id="", tMSS f_file_map=tMSS())
Definition config.hpp:76
std::string id
Definition config.hpp:71
std::string dir
Definition config.hpp:70
static char const * KEY_BWT
Definition config.hpp:122
static char const * KEY_BWT
Definition config.hpp:128
Helper classes to transform width=0 and width=8 to corresponding bwt key.
Definition config.hpp:115
static char const * KEY_BWT
Definition config.hpp:116
static char const * KEY_TEXT
Definition config.hpp:103
static char const * KEY_TEXT
Definition config.hpp:109
Helper classes to transform width=0 and width=8 to corresponding text key.
Definition config.hpp:96
static char const * KEY_TEXT
Definition config.hpp:97