CYCLUS
Loading...
Searching...
No Matches
query_backend.h
Go to the documentation of this file.
1#ifndef CYCLUS_SRC_QUERY_BACKEND_H_
2#define CYCLUS_SRC_QUERY_BACKEND_H_
3
4#include <climits>
5#include <list>
6#include <map>
7#include <set>
8#include <boost/version.hpp>
9
10#if BOOST_VERSION / 100 % 1000 <= 67
11 #include <boost/uuid/sha1.hpp>
12#else
13 #include <boost/uuid/detail/sha1.hpp>
14#endif
15
16#include "blob.h"
17#include "rec_backend.h"
18#include "any.hpp"
19
20#define CYCLUS_UUID_SIZE 16
21#define CYCLUS_SHA1_SIZE 20
22#define CYCLUS_SHA1_NINT 5
23
24namespace cyclus {
25
26/// This is the primary list of all supported database types. All types must
27/// have a constant length unless they begin with the prefix VL_, which stands
28/// for "variable length" or are implicitly variable length, such as blob.
29/// Changing the order here may invalidate previously created databases.
30/// Thus only append to this enum if it is post-1.0.
31enum DbTypes {
32 // primitive types
33 BOOL = 0, // ["bool", 0, ["HDF5", "SQLite"], "BOOL", false]
34 INT, // ["int", 0, ["HDF5", "SQLite"], "INT", false]
35 FLOAT, // ["float", 0, ["HDF5", "SQLite"], "FLOAT", false]
36 DOUBLE, // ["double", 0, ["HDF5", "SQLite"], "DOUBLE", false]
37 STRING, // ["std::string", 1, ["HDF5", "SQLite"], "STRING", false]
38 VL_STRING, // ["std::string", 1, ["HDF5", "SQLite"], "VL_STRING", true]
39 BLOB, // ["cyclus::Blob", 0, ["HDF5", "SQLite"], "BLOB", true]
40 UUID, // ["boost::uuids::uuid", 0, ["HDF5", "SQLite"], "UUID", false]
41 // vector types
42 VECTOR_BOOL, // ["std::vector<bool>", 1, [], ["VECTOR", "BOOL"], false]
43 VL_VECTOR_BOOL, // ["std::vector<bool>", 1, [], ["VL_VECTOR", "BOOL"], true]
44 VECTOR_INT, // ["std::vector<int>", 1, ["HDF5", "SQLite"], ["VECTOR", "INT"], false]
45 VL_VECTOR_INT, // ["std::vector<int>", 1, ["HDF5", "SQLite"], ["VL_VECTOR", "INT"], true]
46 VECTOR_FLOAT, // ["std::vector<float>", 1, ["HDF5"], ["VECTOR", "FLOAT"], false]
47 VL_VECTOR_FLOAT, // ["std::vector<float>", 1, ["HDF5"], ["VL_VECTOR", "FLOAT"], true]
48 VECTOR_DOUBLE, // ["std::vector<double>", 1, ["HDF5", "SQLite"], ["VECTOR", "DOUBLE"], false]
49 VL_VECTOR_DOUBLE, // ["std::vector<double>", 1, ["HDF5", "SQLite"], ["VL_VECTOR", "DOUBLE"], true]
50 VECTOR_STRING, // ["std::vector<std::string>", 2, ["HDF5", "SQLite"], ["VECTOR", "STRING"], false]
51 VL_VECTOR_STRING, // ["std::vector<std::string>", 2, ["HDF5", "SQLite"], ["VL_VECTOR", "STRING"], true]
52 VECTOR_VL_STRING, // ["std::vector<std::string>", 2, ["HDF5", "SQLite"], ["VECTOR", "VL_STRING"], false]
53 VL_VECTOR_VL_STRING, // ["std::vector<std::string>", 2, ["HDF5", "SQLite"], ["VL_VECTOR", "VL_STRING"], true]
54 VECTOR_BLOB, // ["std::vector<cyclus::Blob>", 1, ["HDF5"], ["VECTOR", "BLOB"], false]
55 VL_VECTOR_BLOB, // ["std::vector<cyclus::Blob>", 1, ["HDF5"], ["VL_VECTOR", "BLOB"], true]
56 VECTOR_UUID, // ["std::vector<boost::uuids::uuid>", 1, ["HDF5"], ["VECTOR", "UUID"], false]
57 VL_VECTOR_UUID, // ["std::vector<boost::uuids::uuid>", 1, ["HDF5"], ["VL_VECTOR", "UUID"], true]
58 // set types
59 SET_BOOL, // ["std::set<bool>", 1, [], ["SET", "BOOL"], false]
60 VL_SET_BOOL, // ["std::set<bool>", 1, [], ["VL_SET", "BOOL"], true]
61 SET_INT, // ["std::set<int>", 1, ["HDF5", "SQLite"], ["SET", "INT"], false]
62 VL_SET_INT, // ["std::set<int>", 1, ["HDF5", "SQLite"], ["VL_SET", "INT"], true]
63 SET_FLOAT, // ["std::set<float>", 1, ["HDF5"], ["SET", "FLOAT"], false]
64 VL_SET_FLOAT, // ["std::set<float>", 1, ["HDF5"], ["VL_SET", "FLOAT"], true]
65 SET_DOUBLE, // ["std::set<double>", 1, ["HDF5"], ["SET", "DOUBLE"], false]
66 VL_SET_DOUBLE, // ["std::set<double>", 1, ["HDF5"], ["VL_SET", "DOUBLE"], true]
67 SET_STRING, // ["std::set<std::string>", 2, ["HDF5", "SQLite"], ["SET", "STRING"], false]
68 VL_SET_STRING, // ["std::set<std::string>", 2, ["HDF5", "SQLite"], ["VL_SET", "STRING"], true]
69 SET_VL_STRING, // ["std::set<std::string>", 2, ["HDF5", "SQLite"], ["SET", "VL_STRING"], false]
70 VL_SET_VL_STRING, // ["std::set<std::string>", 2, ["HDF5", "SQLite"], ["VL_SET", "VL_STRING"], true]
71 SET_BLOB, // ["std::set<cyclus::Blob>", 1, ["HDF5"], ["SET", "BLOB"], false]
72 VL_SET_BLOB, // ["std::set<cyclus::Blob>", 1, ["HDF5"], ["VL_SET", "BLOB"], true]
73 SET_UUID, // ["std::set<boost::uuids::uuid>", 1, ["HDF5"], ["SET", "UUID"], false]
74 VL_SET_UUID, // ["std::set<boost::uuids::uuid>", 1, ["HDF5"], ["VL_SET", "UUID"], true]
75 // list types
76 LIST_BOOL, // ["std::list<bool>", 1, ["HDF5"], ["LIST", "BOOL"], false]
77 VL_LIST_BOOL, // ["std::list<bool>", 1, ["HDF5"], ["VL_LIST", "BOOL"], true]
78 LIST_INT, // ["std::list<int>", 1, ["HDF5", "SQLite"], ["LIST", "INT"], false]
79 VL_LIST_INT, // ["std::list<int>", 1, ["HDF5", "SQLite"], ["VL_LIST", "INT"], true]
80 LIST_FLOAT, // ["std::list<float>", 1, ["HDF5"], ["LIST", "FLOAT"], false]
81 VL_LIST_FLOAT, // ["std::list<float>", 1, ["HDF5"], ["VL_LIST", "FLOAT"], true]
82 LIST_DOUBLE, // ["std::list<double>", 1, ["HDF5"], ["LIST", "DOUBLE"], false]
83 VL_LIST_DOUBLE, // ["std::list<double>", 1, ["HDF5"], ["VL_LIST", "DOUBLE"], true]
84 LIST_STRING, // ["std::list<std::string>", 2, ["HDF5", "SQLite"], ["LIST", "STRING"], false]
85 VL_LIST_STRING, // ["std::list<std::string>", 2, ["HDF5", "SQLite"], ["VL_LIST", "STRING"], true]
86 LIST_VL_STRING, // ["std::list<std::string>", 2, ["HDF5", "SQLite"], ["LIST", "VL_STRING"], false]
87 VL_LIST_VL_STRING, // ["std::list<std::string>", 2, ["HDF5", "SQLite"], ["VL_LIST", "VL_STRING"], true]
88 LIST_BLOB, // ["std::list<cyclus::Blob>", 1, ["HDF5"], ["LIST", "BLOB"], false]
89 VL_LIST_BLOB, // ["std::list<cyclus::Blob>", 1, ["HDF5"], ["VL_LIST", "BLOB"], true]
90 LIST_UUID, // ["std::list<boost::uuids::uuid>", 1, ["HDF5"], ["LIST", "UUID"], false]
91 VL_LIST_UUID, // ["std::list<boost::uuids::uuid>", 1, ["HDF5"], ["VL_LIST", "UUID"], true]
92 // pairs - not variable length
93 PAIR_INT_BOOL, // ["std::pair<int, bool>", 0, ["HDF5"], ["PAIR", "INT", "BOOL"], false]
94 PAIR_INT_INT, // ["std::pair<int, int>", 0, ["HDF5"], ["PAIR", "INT", "INT"], false]
95 PAIR_INT_FLOAT, // ["std::pair<int, float>", 0, ["HDF5"], ["PAIR", "INT", "FLOAT"], false]
96 PAIR_INT_DOUBLE, // ["std::pair<int, double>", 0, ["HDF5"], ["PAIR", "INT", "DOUBLE"], false]
97 PAIR_INT_STRING, // ["std::pair<int, std::string>", 1, ["HDF5"], ["PAIR", "INT", "STRING"], false]
98 PAIR_INT_VL_STRING, // ["std::pair<int, std::string>", 1, ["HDF5"], ["PAIR", "INT", "VL_STRING"], false]
99 PAIR_INT_BLOB, // ["std::pair<int, cyclus::Blob>", 0, ["HDF5"], ["PAIR", "INT", "BLOB"], false]
100 PAIR_INT_UUID, // ["std::pair<int, boost::uuids::uuid>", 0, ["HDF5"], ["PAIR", "INT", "UUID"], false]
101 PAIR_STRING_BOOL, // ["std::pair<std::string, bool>", 1, ["HDF5"], ["PAIR", "STRING", "BOOL"], false]
102 PAIR_STRING_INT, // ["std::pair<std::string, int>", 1, ["HDF5"], ["PAIR", "STRING", "INT"], false]
103 PAIR_STRING_FLOAT, // ["std::pair<std::string, float>", 1, ["HDF5"], ["PAIR", "STRING", "FLOAT"], false]
104 PAIR_STRING_DOUBLE, // ["std::pair<std::string, double>", 1, ["HDF5"], ["PAIR", "STRING", "DOUBLE"], false]
105 PAIR_STRING_STRING, // ["std::pair<std::string, std::string>", 2, ["HDF5"], ["PAIR", "STRING", "STRING"], false]
106 PAIR_STRING_VL_STRING, // ["std::pair<std::string, std::string>", 2, ["HDF5"], ["PAIR", "STRING", "VL_STRING"], false]
107 PAIR_STRING_BLOB, // ["std::pair<std::string, cyclus::Blob>", 1, ["HDF5"], ["PAIR", "STRING", "BLOB"], false]
108 PAIR_STRING_UUID, // ["std::pair<std::string, boost::uuids::uuid>", 1, ["HDF5"], ["PAIR", "STRING", "UUID"], false]
109 PAIR_VL_STRING_BOOL, // ["std::pair<std::string, bool>", 1, ["HDF5"], ["PAIR", "VL_STRING", "BOOL"], false]
110 PAIR_VL_STRING_INT, // ["std::pair<std::string, int>", 1, ["HDF5"], ["PAIR", "VL_STRING", "INT"], false]
111 PAIR_VL_STRING_FLOAT, // ["std::pair<std::string, float>", 1, ["HDF5"], ["PAIR", "VL_STRING", "FLOAT"], false]
112 PAIR_VL_STRING_DOUBLE, // ["std::pair<std::string, double>", 1, ["HDF5"], ["PAIR", "VL_STRING", "DOUBLE"], false]
113 PAIR_VL_STRING_STRING, // ["std::pair<std::string, std::string>", 2, ["HDF5"], ["PAIR", "VL_STRING", "STRING"], false]
114 PAIR_VL_STRING_VL_STRING, // ["std::pair<std::string, std::string>", 2, ["HDF5"], ["PAIR", "VL_STRING", "VL_STRING"], false]
115 PAIR_VL_STRING_BLOB, // ["std::pair<std::string, cyclus::Blob>", 1, ["HDF5"], ["PAIR", "VL_STRING", "BLOB"], false]
116 PAIR_VL_STRING_UUID, // ["std::pair<std::string, boost::uuids::uuid>", 1, ["HDF5"], ["PAIR", "VL_STRING", "UUID"], false]
117 // maps with int keys
118 MAP_INT_BOOL, // ["std::map<int, bool>", 1, ["HDF5"], ["MAP", "INT", "BOOL"], false]
119 VL_MAP_INT_BOOL, // ["std::map<int, bool>", 1, ["HDF5"], ["VL_MAP", "INT", "BOOL"], true]
120 MAP_INT_INT, // ["std::map<int, int>", 1, ["HDF5", "SQLite"], ["MAP", "INT", "INT"], false]
121 VL_MAP_INT_INT, // ["std::map<int, int>", 1, ["HDF5", "SQLite"], ["VL_MAP", "INT", "INT"], true]
122 MAP_INT_FLOAT, // ["std::map<int, float>", 1, ["HDF5"], ["MAP", "INT", "FLOAT"], false]
123 VL_MAP_INT_FLOAT, // ["std::map<int, float>", 1, ["HDF5"], ["VL_MAP", "INT", "FLOAT"], true]
124 MAP_INT_DOUBLE, // ["std::map<int, double>", 1, ["HDF5", "SQLite"], ["MAP", "INT", "DOUBLE"], false]
125 VL_MAP_INT_DOUBLE, // ["std::map<int, double>", 1, ["HDF5", "SQLite"], ["VL_MAP", "INT", "DOUBLE"], true]
126 MAP_INT_STRING, // ["std::map<int, std::string>", 2, ["HDF5", "SQLite"], ["MAP", "INT", "STRING"], false]
127 VL_MAP_INT_STRING, // ["std::map<int, std::string>", 2, ["HDF5", "SQLite"], ["VL_MAP", "INT", "STRING"], true]
128 MAP_INT_VL_STRING, // ["std::map<int, std::string>", 2, ["HDF5", "SQLite"], ["MAP", "INT", "VL_STRING"], false]
129 VL_MAP_INT_VL_STRING, // ["std::map<int, std::string>", 2, ["HDF5", "SQLite"], ["VL_MAP", "INT", "VL_STRING"], true]
130 MAP_INT_BLOB, // ["std::map<int, cyclus::Blob>", 1, ["HDF5"], ["MAP", "INT", "BLOB"], false]
131 VL_MAP_INT_BLOB, // ["std::map<int, cyclus::Blob>", 1, ["HDF5"], ["VL_MAP", "INT", "BLOB"], true]
132 MAP_INT_UUID, // ["std::map<int, boost::uuids::uuid>", 1, ["HDF5"], ["MAP", "INT", "UUID"], false]
133 VL_MAP_INT_UUID, // ["std::map<int, boost::uuids::uuid>", 1, ["HDF5"], ["VL_MAP", "INT", "UUID"], true]
134 // maps with fixed-length string keys
135 MAP_STRING_BOOL, // ["std::map<std::string, bool>", 2, ["HDF5"], ["MAP", "STRING", "BOOL"], false]
136 VL_MAP_STRING_BOOL, // ["std::map<std::string, bool>", 2, ["HDF5"], ["VL_MAP", "STRING", "BOOL"], true]
137 MAP_STRING_INT, // ["std::map<std::string, int>", 2, ["HDF5", "SQLite"], ["MAP", "STRING", "INT"], false]
138 VL_MAP_STRING_INT, // ["std::map<std::string, int>", 2, ["HDF5", "SQLite"], ["VL_MAP", "STRING", "INT"], true]
139 MAP_STRING_FLOAT, // ["std::map<std::string, float>", 2, ["HDF5"], ["MAP", "STRING", "FLOAT"], false]
140 VL_MAP_STRING_FLOAT, // ["std::map<std::string, float>", 2, ["HDF5"], ["VL_MAP", "STRING", "FLOAT"], true]
141 MAP_STRING_DOUBLE, // ["std::map<std::string, double>", 2, ["HDF5", "SQLite"], ["MAP", "STRING", "DOUBLE"], false]
142 VL_MAP_STRING_DOUBLE, // ["std::map<std::string, double>", 2, ["HDF5", "SQLite"], ["VL_MAP", "STRING", "DOUBLE"], true]
143 MAP_STRING_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", "STRING"], false]
144 VL_MAP_STRING_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", "STRING"], true]
145 MAP_STRING_VL_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", "VL_STRING"], false]
146 VL_MAP_STRING_VL_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", "VL_STRING"], true]
147 MAP_STRING_BLOB, // ["std::map<std::string, cyclus::Blob>", 2, ["HDF5"], ["MAP", "STRING", "BLOB"], false]
148 VL_MAP_STRING_BLOB, // ["std::map<std::string, cyclus::Blob>", 2, ["HDF5"], ["VL_MAP", "STRING", "BLOB"], true]
149 MAP_STRING_UUID, // ["std::map<std::string, boost::uuids::uuid>", 2, ["HDF5"], ["MAP", "STRING", "UUID"], false]
150 VL_MAP_STRING_UUID, // ["std::map<std::string, boost::uuids::uuid>", 2, ["HDF5"], ["VL_MAP", "STRING", "UUID"], true]
151 // maps with variable length string keys
152 MAP_VL_STRING_BOOL, // ["std::map<std::string, bool>", 2, ["HDF5"], ["MAP", "VL_STRING", "BOOL"], false]
153 VL_MAP_VL_STRING_BOOL, // ["std::map<std::string, bool>", 2, ["HDF5"], ["VL_MAP", "VL_STRING", "BOOL"], true]
154 MAP_VL_STRING_INT, // ["std::map<std::string, int>", 2, ["HDF5", "SQLite"], ["MAP", "VL_STRING", "INT"], false]
155 VL_MAP_VL_STRING_INT, // ["std::map<std::string, int>", 2, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", "INT"], true]
156 MAP_VL_STRING_FLOAT, // ["std::map<std::string, float>", 2, ["HDF5"], ["MAP", "VL_STRING", "FLOAT"], false]
157 VL_MAP_VL_STRING_FLOAT, // ["std::map<std::string, float>", 2, ["HDF5"], ["VL_MAP", "VL_STRING", "FLOAT"], true]
158 MAP_VL_STRING_DOUBLE, // ["std::map<std::string, double>", 2, ["HDF5", "SQLite"], ["MAP", "VL_STRING", "DOUBLE"], false]
159 VL_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, double>", 2, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", "DOUBLE"], true]
160 MAP_VL_STRING_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", "STRING"], false]
161 VL_MAP_VL_STRING_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", "STRING"], true]
162 MAP_VL_STRING_VL_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", "VL_STRING"], false]
163 VL_MAP_VL_STRING_VL_STRING, // ["std::map<std::string, std::string>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", "VL_STRING"], true]
164 MAP_VL_STRING_BLOB, // ["std::map<std::string, cyclus::Blob>", 2, ["HDF5"], ["MAP", "VL_STRING", "BLOB"], false]
165 VL_MAP_VL_STRING_BLOB, // ["std::map<std::string, cyclus::Blob>", 2, ["HDF5"], ["VL_MAP", "VL_STRING", "BLOB"], true]
166 MAP_VL_STRING_UUID, // ["std::map<std::string, boost::uuids::uuid>", 2, ["HDF5"], ["MAP", "VL_STRING", "UUID"], false]
167 VL_MAP_VL_STRING_UUID, // ["std::map<std::string, boost::uuids::uuid>", 2, ["HDF5"], ["VL_MAP", "VL_STRING", "UUID"], true]
168 // maps with pair<int, string> keys and double values
169 MAP_PAIR_INT_STRING_DOUBLE, // ["std::map<std::pair<int, std::string>, double>", 3, ["HDF5"], ["MAP", ["PAIR", "INT", "STRING"], "DOUBLE"], false]
170 VL_MAP_PAIR_INT_STRING_DOUBLE, // ["std::map<std::pair<int, std::string>, double>", 3, ["HDF5"], ["VL_MAP", ["PAIR", "INT", "STRING"], "DOUBLE"], true]
171 MAP_PAIR_INT_VL_STRING_DOUBLE, // ["std::map<std::pair<int, std::string>, double>", 3, ["HDF5"], ["MAP", ["PAIR", "INT", "VL_STRING"], "DOUBLE"], false]
172 VL_MAP_PAIR_INT_VL_STRING_DOUBLE, // ["std::map<std::pair<int, std::string>, double>", 3, ["HDF5"], ["VL_MAP", ["PAIR", "INT", "VL_STRING"], "DOUBLE"], true]
173
174 // map<string, vector<double> >
175 MAP_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["VECTOR", "DOUBLE"]], false]
176 MAP_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_VECTOR", "DOUBLE"]], false]
177 VL_MAP_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VECTOR", "DOUBLE"]], true]
178 MAP_VL_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VECTOR", "DOUBLE"]], false]
179 MAP_VL_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_VECTOR", "DOUBLE"]], false]
180 VL_MAP_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_VECTOR", "DOUBLE"]], true]
181 VL_MAP_VL_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VECTOR", "DOUBLE"]], true]
182 VL_MAP_VL_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::vector<double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_VECTOR", "DOUBLE"]], true]
183
184 // map<string, map<int, double> >
185 MAP_STRING_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["MAP", "INT", "DOUBLE"]], false]
186 MAP_STRING_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_MAP", "INT", "DOUBLE"]], false]
187 VL_MAP_STRING_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["MAP", "INT", "DOUBLE"]], true]
188 MAP_VL_STRING_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["MAP", "INT", "DOUBLE"]], false]
189 MAP_VL_STRING_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_MAP", "INT", "DOUBLE"]], false]
190 VL_MAP_STRING_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_MAP", "INT", "DOUBLE"]], true]
191 VL_MAP_VL_STRING_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["MAP", "INT", "DOUBLE"]], true]
192 VL_MAP_VL_STRING_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::map<int, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_MAP", "INT", "DOUBLE"]], true]
193
194 // map<string, pair<double, map<int, double> > >
195 MAP_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["PAIR", "DOUBLE", ["MAP", "INT", "DOUBLE"]]], false]
196 VL_MAP_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["PAIR", "DOUBLE", ["MAP", "INT", "DOUBLE"]]], true]
197 MAP_VL_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["PAIR", "DOUBLE", ["MAP", "INT", "DOUBLE"]]], false]
198 MAP_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["PAIR", "DOUBLE", ["VL_MAP", "INT", "DOUBLE"]]], false]
199 VL_MAP_VL_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["PAIR", "DOUBLE", ["MAP", "INT", "DOUBLE"]]], true]
200 VL_MAP_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["PAIR", "DOUBLE", ["VL_MAP", "INT", "DOUBLE"]]], true]
201 MAP_VL_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["PAIR", "DOUBLE", ["VL_MAP", "INT", "DOUBLE"]]], false]
202 VL_MAP_VL_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE, // ["std::map<std::string, std::pair<double, std::map<int, double>>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["PAIR", "DOUBLE", ["VL_MAP", "INT", "DOUBLE"]]], true]
203
204 // map<map< string, double > >
205 MAP_INT_MAP_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["MAP", "INT", ["MAP", "STRING", "DOUBLE"]], false]
206 MAP_INT_MAP_VL_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["MAP", "INT", ["MAP", "VL_STRING", "DOUBLE"]], false]
207 VL_MAP_INT_MAP_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "INT", ["MAP", "STRING", "DOUBLE"]], true]
208 VL_MAP_INT_MAP_VL_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "INT", ["MAP", "VL_STRING", "DOUBLE"]], true]
209 MAP_INT_VL_MAP_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["MAP", "INT", ["VL_MAP", "STRING", "DOUBLE"]], false]
210 MAP_INT_VL_MAP_VL_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["MAP", "INT", ["VL_MAP", "VL_STRING", "DOUBLE"]], false]
211 VL_MAP_INT_VL_MAP_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "INT", ["VL_MAP", "STRING", "DOUBLE"]], true]
212 VL_MAP_INT_VL_MAP_VL_STRING_DOUBLE, // ["std::map<int, std::map<std::string, double>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "INT", ["VL_MAP", "VL_STRING", "DOUBLE"]], true]
213
214 // map< string, vector< pair<int, pair<string string> > > >
215 MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], false]
216 MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], false]
217 MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], false]
218 MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], false]
219 MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], false]
220 MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], false]
221 MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], false]
222 MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], false]
223 MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], false]
224 MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], false]
225 MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], false]
226 MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], false]
227 MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], false]
228 MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], false]
229 MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], false]
230 MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], false]
231 VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], true]
232 VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], true]
233 VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], true]
234 VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], true]
235 VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], true]
236 VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], true]
237 VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], true]
238 VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], true]
239 VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], true]
240 VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], true]
241 VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], true]
242 VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], true]
243 VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]]], true]
244 VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]]], true]
245 VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]]], true]
246 VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>", 7, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]]], true]
247
248 // list< pair<int, int>
249 LIST_PAIR_INT_INT, // ["std::list<std::pair<int, int>>", 2, ["HDF5", "SQLite"], ["LIST", ["PAIR", "INT", "INT"]], false]
250 VL_LIST_PAIR_INT_INT, // ["std::list<std::pair<int, int>>", 2, ["HDF5", "SQLite"], ["VL_LIST", ["PAIR", "INT", "INT"]], true]
251
252 // map< string, pair< string, vector<double> > > >
253 MAP_STRING_PAIR_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "STRING", ["PAIR", "STRING", ["VECTOR", "DOUBLE"]]], false]
254 MAP_STRING_PAIR_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "STRING", ["PAIR", "STRING", ["VL_VECTOR", "DOUBLE"]]], false]
255 MAP_STRING_PAIR_VL_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "STRING", ["PAIR", "VL_STRING", ["VECTOR", "DOUBLE"]]], false]
256 MAP_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "STRING", ["PAIR", "VL_STRING", ["VL_VECTOR", "DOUBLE"]]], false]
257 MAP_VL_STRING_PAIR_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["PAIR", "STRING", ["VECTOR", "DOUBLE"]]], false]
258 MAP_VL_STRING_PAIR_VL_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["PAIR", "VL_STRING", ["VECTOR", "DOUBLE"]]], false]
259 MAP_VL_STRING_PAIR_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["PAIR", "STRING", ["VL_VECTOR", "DOUBLE"]]], false]
260 MAP_VL_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["PAIR", "VL_STRING", ["VL_VECTOR", "DOUBLE"]]], false]
261 VL_MAP_STRING_PAIR_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["PAIR", "STRING", ["VECTOR", "DOUBLE"]]], true]
262 VL_MAP_VL_STRING_PAIR_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["PAIR", "STRING", ["VECTOR", "DOUBLE"]]], true]
263 VL_MAP_STRING_PAIR_VL_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["PAIR", "VL_STRING", ["VECTOR", "DOUBLE"]]], true]
264 VL_MAP_STRING_PAIR_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["PAIR", "STRING", ["VL_VECTOR", "DOUBLE"]]], true]
265 VL_MAP_VL_STRING_PAIR_VL_STRING_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["PAIR", "VL_STRING", ["VECTOR", "DOUBLE"]]], true]
266 VL_MAP_VL_STRING_PAIR_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["PAIR", "STRING", ["VL_VECTOR", "DOUBLE"]]], true]
267 VL_MAP_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["PAIR", "VL_STRING", ["VL_VECTOR", "DOUBLE"]]], true]
268 VL_MAP_VL_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE, // ["std::map<std::string, std::pair<std::string, std::vector<double>>>", 5, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["PAIR", "VL_STRING", ["VL_VECTOR", "DOUBLE"]]], true]
269
270 // map<string, map<string, int> >
271 MAP_STRING_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["MAP", "STRING", "INT"]], false]
272 MAP_STRING_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["MAP", "VL_STRING", "INT"]], false]
273 MAP_STRING_VL_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_MAP", "STRING", "INT"]], false]
274 MAP_STRING_VL_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_MAP", "VL_STRING", "INT"]], false]
275 MAP_VL_STRING_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["MAP", "STRING", "INT"]], false]
276 MAP_VL_STRING_VL_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_MAP", "STRING", "INT"]], false]
277 MAP_VL_STRING_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["MAP", "VL_STRING", "INT"]], false]
278 MAP_VL_STRING_VL_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_MAP", "VL_STRING", "INT"]], false]
279 VL_MAP_STRING_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["MAP", "STRING", "INT"]], true]
280 VL_MAP_VL_STRING_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["MAP", "STRING", "INT"]], true]
281 VL_MAP_STRING_VL_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_MAP", "STRING", "INT"]], true]
282 VL_MAP_STRING_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["MAP", "VL_STRING", "INT"]], true]
283 VL_MAP_STRING_VL_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_MAP", "VL_STRING", "INT"]], true]
284 VL_MAP_VL_STRING_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["MAP", "VL_STRING", "INT"]], true]
285 VL_MAP_VL_STRING_VL_MAP_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_MAP", "STRING", "INT"]], true]
286 VL_MAP_VL_STRING_VL_MAP_VL_STRING_INT, // ["std::map<std::string, std::map<std::string, int>>", 3, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_MAP", "VL_STRING", "INT"]], true]
287
288 // vector<pair<pair<double, double>, map<string, double>>>
289 VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["MAP", "STRING", "DOUBLE"]]], false]
290 VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_VL_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["MAP", "VL_STRING", "DOUBLE"]]], false]
291 VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["VL_MAP", "STRING", "DOUBLE"]]], false]
292 VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_VL_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["VL_MAP", "VL_STRING", "DOUBLE"]]], false]
293 VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VL_VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["MAP", "STRING", "DOUBLE"]]], true]
294 VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_VL_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VL_VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["MAP", "VL_STRING", "DOUBLE"]]], true]
295 VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VL_VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["VL_MAP", "STRING", "DOUBLE"]]], true]
296 VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_VL_STRING_DOUBLE, // ["std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>", 5, ["HDF5", "SQLite"], ["VL_VECTOR", ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["VL_MAP", "VL_STRING", "DOUBLE"]]], true]
297
298 // pair<int, pair<string, string>>
299 PAIR_INT_PAIR_STRING_STRING, // ["std::pair<int, std::pair<std::string, std::string>>", 2, ["HDF5"], ["PAIR", "INT", ["PAIR", "STRING", "STRING"]], false]
300 PAIR_INT_PAIR_VL_STRING_STRING, // ["std::pair<int, std::pair<std::string, std::string>>", 2, ["HDF5"], ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]], false]
301 PAIR_INT_PAIR_STRING_VL_STRING, // ["std::pair<int, std::pair<std::string, std::string>>", 2, ["HDF5"], ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]], false]
302 PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::pair<int, std::pair<std::string, std::string>>", 2, ["HDF5"], ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]], false]
303
304 // pair<double, double>
305 PAIR_DOUBLE_DOUBLE, // ["std::pair<double, double>", 0, ["HDF5"], ["PAIR", "DOUBLE", "DOUBLE"], false]
306
307 // pair<pair<double, double>, map<string, double>>
308 PAIR_PAIR_DOUBLE_DOUBLE_MAP_STRING_DOUBLE, // ["std::pair<std::pair<double, double>, std::map<std::string, double>>", 4, ["HDF5"], ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["MAP", "STRING", "DOUBLE"]], false]
309 PAIR_PAIR_DOUBLE_DOUBLE_MAP_VL_STRING_DOUBLE, // ["std::pair<std::pair<double, double>, std::map<std::string, double>>", 4, ["HDF5"], ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["MAP", "VL_STRING", "DOUBLE"]], false]
310 PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_STRING_DOUBLE, // ["std::pair<std::pair<double, double>, std::map<std::string, double>>", 4, ["HDF5"], ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["VL_MAP", "STRING", "DOUBLE"]], false]
311 PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_VL_STRING_DOUBLE, // ["std::pair<std::pair<double, double>, std::map<std::string, double>>", 4, ["HDF5"], ["PAIR", ["PAIR", "DOUBLE", "DOUBLE"], ["VL_MAP", "VL_STRING", "DOUBLE"]], false]
312
313 // Resource Tools
314 MATERIAL, // ["cyclus::Material", 0, [], "MATERIAL", false]
315 PRODUCT, // ["cyclus::Product", 0, [], "PRODUCT", false]
316 RES_BUF_MATERIAL, // ["cyclus::toolkit::ResBuf<cyclus::Material>", 1, [], ["RES_BUF", "MATERIAL"], false]
317 RES_BUF_PRODUCT, // ["cyclus::toolkit::ResBuf<cyclus::Product>", 1, [], ["RES_BUF", "PRODUCT"], false]
318 RES_MAP_INT_MATERIAL, // ["cyclus::toolkit::ResMap<int, cyclus::Material>", 2, [], ["RES_MAP", "INT", "MATERIAL"], false]
319 RES_MAP_INT_PRODUCT, // ["cyclus::toolkit::ResMap<int, cyclus::Product>", 2, [], ["RES_MAP", "INT", "PRODUCT"], false]
320 RES_MAP_STRING_MATERIAL, // ["cyclus::toolkit::ResMap<std::string, cyclus::Material>", 2, [], ["RES_MAP", "STRING", "MATERIAL"], false]
321 RES_MAP_STRING_PRODUCT, // ["cyclus::toolkit::ResMap<std::string, cyclus::Product>", 2, [], ["RES_MAP", "STRING", "PRODUCT"], false]
322 RES_MAP_VL_STRING_MATERIAL, // ["cyclus::toolkit::ResMap<std::string, cyclus::Material>", 2, [], ["RES_MAP", "VL_STRING", "MATERIAL"], false]
323 RES_MAP_VL_STRING_PRODUCT, // ["cyclus::toolkit::ResMap<std::string, cyclus::Product>", 2, [], ["RES_MAP", "VL_STRING", "PRODUCT"], false]
324
325 // pair<double, map<int, double>>
326 PAIR_DOUBLE_MAP_INT_DOUBLE, // ["std::pair<double, std::map<int, double>>", 2, ["HDF5"], ["PAIR", "DOUBLE", ["MAP", "INT", "DOUBLE"]], false]
327 PAIR_DOUBLE_VL_MAP_INT_DOUBLE, // ["std::pair<double, std::map<int, double>>", 2, ["HDF5"], ["PAIR", "DOUBLE", ["VL_MAP", "INT", "DOUBLE"]], false]
328
329 // vector<pair<int, pair<string, string>>>
330 VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]], false]
331 VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]], false]
332 VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]], false]
333 VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]], false]
334 VL_VECTOR_PAIR_INT_PAIR_STRING_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "STRING"]]], true]
335 VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "STRING"]]], true]
336 VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "STRING", "VL_STRING"]]], true]
337 VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING, // ["std::vector<std::pair<int, std::pair<std::string, std::string>>>", 1, ["HDF5"], ["VL_VECTOR", ["PAIR", "INT", ["PAIR", "VL_STRING", "VL_STRING"]]], true]
338
339 PAIR_STRING_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "STRING", ["VECTOR", "DOUBLE"]], false]
340 PAIR_VL_STRING_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "VL_STRING", ["VECTOR", "DOUBLE"]], false]
341 PAIR_STRING_VL_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "STRING", ["VL_VECTOR", "DOUBLE"]], false]
342 PAIR_VL_STRING_VL_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "VL_STRING", ["VL_VECTOR", "DOUBLE"]], false]
343
344 //map<pair<string, string>, int>
345 MAP_PAIR_STRING_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["MAP", ["PAIR", "STRING", "STRING"], "INT"], false]
346 MAP_PAIR_STRING_VL_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["MAP", ["PAIR", "STRING", "VL_STRING"], "INT"], false]
347 MAP_PAIR_VL_STRING_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["MAP", ["PAIR", "VL_STRING", "STRING"], "INT"], false]
348 MAP_PAIR_VL_STRING_VL_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["MAP", ["PAIR", "VL_STRING", "VL_STRING"], "INT"], false]
349 VL_MAP_PAIR_STRING_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["VL_MAP", ["PAIR", "STRING", "STRING"], "INT"], true]
350 VL_MAP_PAIR_STRING_VL_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["VL_MAP", ["PAIR", "STRING", "VL_STRING"], "INT"], true]
351 VL_MAP_PAIR_VL_STRING_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["VL_MAP", ["PAIR", "VL_STRING", "STRING"], "INT"], true]
352 VL_MAP_PAIR_VL_STRING_VL_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["VL_MAP", ["PAIR", "VL_STRING", "VL_STRING"], "INT"], true]
353
354 // map<string, map<string, double> >
355 MAP_STRING_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["MAP", "STRING", "DOUBLE"]], false]
356 MAP_STRING_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["MAP", "VL_STRING", "DOUBLE"]], false]
357 MAP_STRING_VL_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_MAP", "STRING", "DOUBLE"]], false]
358 MAP_STRING_VL_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["VL_MAP", "VL_STRING", "DOUBLE"]], false]
359 MAP_VL_STRING_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["MAP", "STRING", "DOUBLE"]], false]
360 MAP_VL_STRING_VL_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_MAP", "STRING", "DOUBLE"]], false]
361 MAP_VL_STRING_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["MAP", "VL_STRING", "DOUBLE"]], false]
362 MAP_VL_STRING_VL_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "VL_STRING", ["VL_MAP", "VL_STRING", "DOUBLE"]], false]
363 VL_MAP_STRING_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["MAP", "STRING", "DOUBLE"]], true]
364 VL_MAP_VL_STRING_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["MAP", "STRING", "DOUBLE"]], true]
365 VL_MAP_STRING_VL_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_MAP", "STRING", "DOUBLE"]], true]
366 VL_MAP_STRING_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["MAP", "VL_STRING", "DOUBLE"]], true]
367 VL_MAP_STRING_VL_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "STRING", ["VL_MAP", "VL_STRING", "DOUBLE"]], true]
368 VL_MAP_VL_STRING_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["MAP", "VL_STRING", "DOUBLE"]], true]
369 VL_MAP_VL_STRING_VL_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_MAP", "STRING", "DOUBLE"]], true]
370 VL_MAP_VL_STRING_VL_MAP_VL_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["VL_MAP", "VL_STRING", ["VL_MAP", "VL_STRING", "DOUBLE"]], true]
371 // append new types only:
372};
373
374/// Represents operation codes for condition checking.
383
384/// Represents a condition used to filter rows returned by a query.
385class Cond {
386 public:
387 Cond() {}
388
389 Cond(std::string field, std::string op, boost::spirit::hold_any val)
390 : field(field),
391 op(op),
392 val(val) {
393 if (op == "<")
394 opcode = LT;
395 else if (op == ">")
396 opcode = GT;
397 else if (op == "<=")
398 opcode = LE;
399 else if (op == ">=")
400 opcode = GE;
401 else if (op == "==")
402 opcode = EQ;
403 else if (op == "!=")
404 opcode = NE;
405 else
406 throw ValueError("operation '" + op + "' not valid for field '" + \
407 field + "'.");
408 }
409
410 /// table column name
411 std::string field;
412
413 /// One of: "<", ">", "<=", ">=", "==", "!="
414 std::string op;
415
416 /// The CmpOpCode cooresponding to op.
418
419 /// value supported by backend(s) in use
421};
422
423typedef std::vector<boost::spirit::hold_any> QueryRow;
424
425/// Meta data and results of a query.
427 public:
428 /// names of each field returned by a query
429 std::vector<std::string> fields;
430
431 /// types of each field returned by a query.
432 std::vector<DbTypes> types;
433
434 /// ordered results of a query
435 std::vector<QueryRow> rows;
436
437 void Reset() {
438 fields.clear();
439 types.clear();
440 rows.clear();
441 }
442
443 /// Convenience method for retrieving a value from a specific row and named
444 /// field (column). The caller is responsible for specifying a valid templated
445 /// type to cast to. Example use:
446 ///
447 /// @code
448 ///
449 /// QueryResult qr = ...
450 ///
451 /// for (int i = 0; i < qr.rows.size(); ++i) {
452 /// std::cout << qr.GetVal<int>("field1", i) << "\n";
453 /// std::cout << qr.GetVal<double>("field2", i) << "\n";
454 /// std::cout << qr.GetVal<std::string>("field3", i) << "\n";
455 /// }
456 ///
457 /// @endcode
458 template <class T>
459 T GetVal(std::string field, int row = 0) {
460 if (rows.empty())
461 throw StateError("No rows found during query for field " + field);
462
463 if (row >= rows.size()) {
464 throw KeyError("index larger than number of query rows for field "
465 + field);
466 }
467
468 int field_idx = -1;
469 for (int i = 0; i < fields.size(); ++i) {
470 if (fields[i] == field) {
471 field_idx = i;
472 break;
473 }
474 }
475 if (field_idx == -1) {
476 throw KeyError("query result has no such field " + field);
477 }
478
479 return rows[row][field_idx].cast<T>();
480 }
481};
482
483/// Represents column information.
490 std::string table;
491 std::string col;
492 int index;
494 std::vector<int> shape;
495};
496
497/// Interface implemented by backends that support rudimentary querying.
499 public:
500 virtual ~QueryableBackend() {}
501
502 /// Return a set of rows from the specificed table that match all given
503 /// conditions. Conditions are AND'd together. conds may be NULL.
504 virtual QueryResult Query(std::string table, std::vector<Cond>* conds) = 0;
505
506 /// Return a map of column names of the specified table to the associated
507 /// database type.
508 virtual std::map<std::string, DbTypes> ColumnTypes(std::string table) = 0;
509
510 /// Return information about all columns of a table.
511 virtual std::list<ColumnInfo> Schema(std::string table) = 0;
512
513 /// Return a set of all table names currently in the database.
514 virtual std::set<std::string> Tables() = 0;
515};
516
517/// Interface implemented by backends that support recording and querying.
519 public:
520 virtual ~FullBackend() {}
521};
522
523/// Wrapper class for QueryableBackends that injects a set of Cond's into every
524/// query before being executed.
526 public:
528 : b_(b),
529 to_inject_(to_inject) {}
530
531 virtual QueryResult Query(std::string table, std::vector<Cond>* conds) {
532 if (conds == NULL) {
533 return b_->Query(table, &to_inject_);
534 }
535
536 std::vector<Cond> c = *conds;
537 for (int i = 0; i < to_inject_.size(); ++i) {
538 c.push_back(to_inject_[i]);
539 }
540 return b_->Query(table, &c);
541 }
542
543 virtual std::map<std::string, DbTypes> ColumnTypes(std::string table) {
544 return b_->ColumnTypes(table);
545 }
546
547 virtual std::list<ColumnInfo> Schema(std::string table) {
548 return b_->Schema(table);
549 }
550
551 virtual std::set<std::string> Tables() { return b_->Tables(); }
552
553 private:
555 std::vector<Cond> to_inject_;
556};
557
558/// Wrapper class for QueryableBackends that injects prefix in front of the
559/// title/table for every query before being executed. A query to the
560/// "MyAgentTable" table will actually be passed to the wrapped backend as
561/// [prefix] + "MyAgentTable".
563 public:
564 PrefixInjector(QueryableBackend* b, std::string prefix)
565 : b_(b),
566 prefix_(prefix) {}
567
568 virtual QueryResult Query(std::string table, std::vector<Cond>* conds) {
569 return b_->Query(prefix_ + table, conds);
570 }
571
572 virtual std::map<std::string, DbTypes> ColumnTypes(std::string table) {
573 return b_->ColumnTypes(table);
574 }
575
576 virtual std::list<ColumnInfo> Schema(std::string table) {
577 return b_->Schema(table);
578 }
579
580 virtual std::set<std::string> Tables() { return b_->Tables(); }
581
582 private:
584 std::string prefix_;
585};
586
587/// Compares a condiontion for a single value
588template <typename T>
589inline bool CmpCond(T* x, Cond* cond) {
590 bool rtn;
591 switch (cond->opcode) {
592 case LT: {
593 rtn = (*x) < cond->val.cast<T>();
594 break;
595 }
596 case GT: {
597 rtn = (*x) > cond->val.cast<T>();
598 break;
599 }
600 case LE: {
601 rtn = (*x) <= cond->val.cast<T>();
602 break;
603 }
604 case GE: {
605 rtn = (*x) >= cond->val.cast<T>();
606 break;
607 }
608 case EQ: {
609 rtn = (*x) == cond->val.cast<T>();
610 break;
611 }
612 case NE: {
613 rtn = (*x) != cond->val.cast<T>();
614 break;
615 }
616 }
617 return rtn;
618}
619
620/// Compares all condiontions for a value
621template <typename T>
622inline bool CmpConds(T* x, std::vector<Cond*>* conds) {
623 int i;
624 for (i = 0; i < conds->size(); ++i)
625 if (!CmpCond<T>(&(*x), (*conds)[i]))
626 return false;
627 return true;
628}
629
630/// The digest type for SHA1s.
631///
632/// This class is a hack around a language deficiency in C++. You cannot pass
633/// around an array (unsinged int[5]) between function calls. You can only
634/// pass pointers, which would involve lost of new/free and heap shenanigans
635/// that are not needed for a dumb container. Therefore Sha1::Digest() cannot
636/// return what would be most natural. The second most natural thing would be
637/// a std::array<unsigned int, 5>. However, std::array is a C++11 feature and
638/// we are not yet ready to go down that road.
639///
640/// To pass an array into and out of a function it has to be inside of struct
641/// or a class. I chose a class here since there are many member functions.
642///
643/// The reason why this is public is that it needs to be directly writable
644/// from buffers coming from HDF5. In the future, this really should just be
645/// a std::array.
646class Digest {
647 public:
648 unsigned int val[CYCLUS_SHA1_NINT];
649
650 /// Casts the value of this digest to a vector of the templated type.
651 template <typename T>
652 inline std::vector<T> cast() const {
653 std::vector<T> rtn = std::vector<T>(CYCLUS_SHA1_NINT);
654 for (unsigned int i = 0; i < CYCLUS_SHA1_NINT; ++i)
655 rtn[i] = static_cast<T>(val[i]);
656 return rtn;
657 }
658
659 // operators
660 inline std::ostream& operator<<(std::ostream& out) const {
661 return out << "[" << val[0] << ", " << val[1] << ", " << val[2] << \
662 ", " << val[3] << ", " << val[4] << "]";
663 }
664
665 inline bool operator< (const cyclus::Digest& rhs) const {
666 bool rtn = false;
667 for (int i = 0; i < CYCLUS_SHA1_NINT; ++i) {
668 if (val[i] < rhs.val[i]) {
669 rtn = true;
670 break;
671 } else if (val[i] > rhs.val[i]) {
672 rtn = false;
673 break;
674 } // else they are equal and we need to check the next index
675 }
676 return rtn;
677 }
678
679 inline bool operator> (const cyclus::Digest& rhs) const {
680 return !operator<(rhs) && !operator==(rhs);
681 }
682
683 inline bool operator<=(const cyclus::Digest& rhs) const {
684 return !operator>(rhs);
685 }
686
687 inline bool operator>=(const cyclus::Digest& rhs) const {
688 return !operator<(rhs);
689 }
690
691 inline bool operator==(const cyclus::Digest& rhs) const {
692 bool rtn = true;
693 for (int i = 0; i < CYCLUS_SHA1_NINT; ++i) {
694 if (val[i] != rhs.val[i]) {
695 rtn = false;
696 break;
697 } // else they are equal and we need to check the next index.
698 }
699 return rtn;
700 }
701
702 inline bool operator!=(const cyclus::Digest& rhs) const {
703 return !operator==(rhs);
704 }
705};
706
707class Sha1 {
708 public:
709 Sha1() { hash_ = boost::uuids::detail::sha1(); }
710
711 /// Clears the current hash value to its default state.
712 inline void Clear() { hash_.reset(); }
713
714 /// Updates the hash value in-place.
715 /// \{
716 inline void Update(const std::string& s) {
717 hash_.process_bytes(s.c_str(), s.size());
718 }
719
720 inline void Update(const Blob& b) { Update(b.str()); }
721
722 inline void Update(const std::vector<int>& x) {
723 hash_.process_bytes(&x[0], x.size() * sizeof(int));
724 }
725
726 inline void Update(const std::vector<float>& x) {
727 hash_.process_bytes(&x[0], x.size() * sizeof(float));
728 }
729
730 inline void Update(const std::vector<double>& x) {
731 hash_.process_bytes(&x[0], x.size() * sizeof(double));
732 }
733
734 inline void Update(const std::vector<std::string>& x) {
735 for (unsigned int i = 0; i < x.size(); ++i)
736 hash_.process_bytes(x[i].c_str(), x[i].size());
737 }
738
739 inline void Update(const std::vector<cyclus::Blob>& x) {
740 for (unsigned int i = 0; i < x.size(); ++i)
741 hash_.process_bytes(x[i].str().c_str(), x[i].str().size());
742 }
743
744 inline void Update(const std::vector<boost::uuids::uuid>& x) {
745 std::vector<boost::uuids::uuid>::const_iterator it = x.begin();
746 for (; it != x.end(); ++it)
747 hash_.process_bytes(&(*it), CYCLUS_UUID_SIZE);
748 }
749
750 inline void Update(const std::set<int>& x) {
751 std::set<int>::iterator it = x.begin();
752 for (; it != x.end(); ++it)
753 hash_.process_bytes(&(*it), sizeof(int));
754 }
755
756 inline void Update(const std::set<bool>& x) {
757 std::set<bool>::iterator it = x.begin();
758 for (; it != x.end(); ++it)
759 hash_.process_bytes(&(*it), sizeof(bool));
760 }
761
762 inline void Update(const std::set<double>& x) {
763 std::set<double>::iterator it = x.begin();
764 for (; it != x.end(); ++it)
765 hash_.process_bytes(&(*it), sizeof(double));
766 }
767
768 inline void Update(const std::set<float>& x) {
769 std::set<float>::iterator it = x.begin();
770 for (; it != x.end(); ++it)
771 hash_.process_bytes(&(*it), sizeof(float));
772 }
773
774 inline void Update(const std::set<cyclus::Blob>& x) {
775 std::set<cyclus::Blob>::iterator it = x.begin();
776 for (; it != x.end(); ++it)
777 hash_.process_bytes(it->str().c_str(), it->str().size());
778 }
779
780 inline void Update(const std::set<boost::uuids::uuid>& x) {
781 std::set<boost::uuids::uuid>::iterator it = x.begin();
782 for (; it != x.end(); ++it)
783 hash_.process_bytes(&(*it), CYCLUS_UUID_SIZE);
784 }
785
786 inline void Update(const std::set<std::string>& x) {
787 std::set<std::string>::iterator it = x.begin();
788 for (; it != x.end(); ++it)
789 hash_.process_bytes(it->c_str(), it->size());
790 }
791
792 inline void Update(const std::list<int>& x) {
793 std::list<int>::const_iterator it = x.begin();
794 for (; it != x.end(); ++it)
795 hash_.process_bytes(&(*it), sizeof(int));
796 }
797
798 inline void Update(const std::list<bool>& x) {
799 std::list<bool>::const_iterator it = x.begin();
800 for (; it != x.end(); ++it)
801 hash_.process_bytes(&(*it), sizeof(bool));
802 }
803
804 inline void Update(const std::list<double>& x) {
805 std::list<double>::const_iterator it = x.begin();
806 for (; it != x.end(); ++it)
807 hash_.process_bytes(&(*it), sizeof(double));
808 }
809
810 inline void Update(const std::list<float>& x) {
811 std::list<float>::const_iterator it = x.begin();
812 for (; it != x.end(); ++it)
813 hash_.process_bytes(&(*it), sizeof(float));
814 }
815
816 inline void Update(const std::list<std::string>& x) {
817 std::list<std::string>::const_iterator it = x.begin();
818 for (; it != x.end(); ++it)
819 hash_.process_bytes(it->c_str(), it->size());
820 }
821
822 inline void Update(const std::list<cyclus::Blob>& x) {
823 std::list<cyclus::Blob>::const_iterator it = x.begin();
824 for (; it != x.end(); ++it)
825 hash_.process_bytes(it->str().c_str(), it->str().size());
826 }
827
828 inline void Update(const std::list<boost::uuids::uuid>& x) {
829 std::list<boost::uuids::uuid>::const_iterator it = x.begin();
830 for (; it != x.end(); ++it)
831 hash_.process_bytes(&(*it), CYCLUS_UUID_SIZE);
832 }
833
834 inline void Update(const std::pair<int, int>& x) {
835 hash_.process_bytes(&(x.first), sizeof(int));
836 hash_.process_bytes(&(x.second), sizeof(int));
837 }
838
839 inline void Update(const std::pair<int, std::string>& x) {
840 hash_.process_bytes(&(x.first), sizeof(int));
841 hash_.process_bytes(x.second.c_str(), x.second.size());
842 }
843
844 inline void Update(const std::map<int, int>& x) {
845 std::map<int, int>::const_iterator it = x.begin();
846 for (; it != x.end(); ++it) {
847 hash_.process_bytes(&(it->first), sizeof(int));
848 hash_.process_bytes(&(it->second), sizeof(int));
849 }
850 }
851
852 inline void Update(const std::map<int, bool>& x) {
853 std::map<int, bool>::const_iterator it = x.begin();
854 for (; it != x.end(); ++it) {
855 hash_.process_bytes(&(it->first), sizeof(int));
856 hash_.process_bytes(&(it->second), sizeof(bool));
857 }
858 }
859
860 inline void Update(const std::map<int, double>& x) {
861 std::map<int, double>::const_iterator it = x.begin();
862 for (; it != x.end(); ++it) {
863 hash_.process_bytes(&(it->first), sizeof(int));
864 hash_.process_bytes(&(it->second), sizeof(double));
865 }
866 }
867
868 inline void Update(const std::map<int, float>& x) {
869 std::map<int, float>::const_iterator it = x.begin();
870 for (; it != x.end(); ++it) {
871 hash_.process_bytes(&(it->first), sizeof(int));
872 hash_.process_bytes(&(it->second), sizeof(float));
873 }
874 }
875
876 inline void Update(const std::map<int, cyclus::Blob>& x) {
877 std::map<int, cyclus::Blob>::const_iterator it = x.begin();
878 for (; it != x.end(); ++it) {
879 hash_.process_bytes(&(it->first), sizeof(int));
880 hash_.process_bytes(it->second.str().c_str(), it->second.str().size());
881 }
882 }
883
884 inline void Update(const std::map<int, boost::uuids::uuid>& x) {
885 std::map<int, boost::uuids::uuid>::const_iterator it = x.begin();
886 for (; it != x.end(); ++it) {
887 hash_.process_bytes(&(it->first), sizeof(int));
888 hash_.process_bytes(&(it->second), CYCLUS_UUID_SIZE);
889 }
890 }
891
892 inline void Update(const std::map<int, std::string>& x) {
893 std::map<int, std::string>::const_iterator it = x.begin();
894 for (; it != x.end(); ++it) {
895 hash_.process_bytes(&(it->first), sizeof(int));
896 hash_.process_bytes(it->second.c_str(), it->second.size());
897 }
898 }
899
900 inline void Update(const std::map<std::string, int>& x) {
901 std::map<std::string, int>::const_iterator it = x.begin();
902 for (; it != x.end(); ++it) {
903 hash_.process_bytes(it->first.c_str(), it->first.size());
904 hash_.process_bytes(&(it->second), sizeof(int));
905 }
906 }
907
908 inline void Update(const std::map<std::string, double>& x) {
909 std::map<std::string, double>::const_iterator it = x.begin();
910 for (; it != x.end(); ++it) {
911 hash_.process_bytes(it->first.c_str(), it->first.size());
912 hash_.process_bytes(&(it->second), sizeof(double));
913 }
914 }
915
916 inline void Update(const std::map<std::string, float>& x) {
917 std::map<std::string, float>::const_iterator it = x.begin();
918 for (; it != x.end(); ++it) {
919 hash_.process_bytes(it->first.c_str(), it->first.size());
920 hash_.process_bytes(&(it->second), sizeof(float));
921 }
922 }
923
924 inline void Update(const std::map<std::string, bool>& x) {
925 std::map<std::string, bool>::const_iterator it = x.begin();
926 for (; it != x.end(); ++it) {
927 hash_.process_bytes(it->first.c_str(), it->first.size());
928 hash_.process_bytes(&(it->second), sizeof(bool));
929 }
930 }
931
932 inline void Update(const std::map<std::string, cyclus::Blob>& x) {
933 std::map<std::string, cyclus::Blob>::const_iterator it = x.begin();
934 for (; it != x.end(); ++it) {
935 hash_.process_bytes(it->first.c_str(), it->first.size());
936 hash_.process_bytes(it->second.str().c_str(), it->second.str().size());
937 }
938 }
939
940 inline void Update(const std::map<std::string, boost::uuids::uuid>& x) {
941 std::map<std::string, boost::uuids::uuid>::const_iterator it = x.begin();
942 for (; it != x.end(); ++it) {
943 hash_.process_bytes(it->first.c_str(), it->first.size());
944 hash_.process_bytes(&(it->second), CYCLUS_UUID_SIZE);
945 }
946 }
947
948 inline void Update(const std::map<std::string, std::string>& x) {
949 std::map<std::string, std::string>::const_iterator it = x.begin();
950 for (; it != x.end(); ++it) {
951 hash_.process_bytes(it->first.c_str(), it->first.size());
952 hash_.process_bytes(it->second.c_str(), it->second.size());
953 }
954 }
955
956 inline void Update(const std::map<std::pair<int, std::string>, double>& x) {
957 std::map<std::pair<int, std::string>, double>::const_iterator it = x.begin();
958 for (; it != x.end(); ++it) {
959 hash_.process_bytes(&(it->first.first), sizeof(int));
960 hash_.process_bytes(it->first.second.c_str(), it->first.second.size());
961 hash_.process_bytes(&(it->second), sizeof(double));
962 }
963 }
964
965 inline void Update(const std::map<std::pair<std::string, std::string>, int>& x) {
966 std::map<std::pair<std::string, std::string>, int>::const_iterator it = x.begin();
967 for (; it != x.end(); ++it) {
968 hash_.process_bytes(it->first.first.c_str(), it->first.first.size());
969 hash_.process_bytes(it->first.second.c_str(), it->first.second.size());
970 hash_.process_bytes(&(it->second), sizeof(int));
971 }
972 }
973
974 inline void Update(const std::map<std::string, std::vector<double>>& x) {
975 std::map<std::string, std::vector<double>>::const_iterator it = x.begin();
976 for (; it != x.end(); ++it) {
977 hash_.process_bytes(it->first.c_str(), it->first.size());
978 Update(it->second);
979 }
980 }
981
982 inline void Update(const std::map<std::string, std::map<int, double>>& x) {
983 std::map<std::string, std::map<int, double>>::const_iterator it = x.begin();
984 for (; it != x.end(); ++it) {
985 hash_.process_bytes(it->first.c_str(), it->first.size());
986 Update(it->second);
987 }
988 }
989
990 inline void Update(const std::map<int, std::map<std::string, double>>& x) {
991 std::map<int, std::map<std::string, double>>::const_iterator it = x.begin();
992 for (; it != x.end(); ++it) {
993 hash_.process_bytes(&(it->first), sizeof(int));
994 Update(it->second);
995 }
996 }
997
998 inline void Update(const std::pair<double, std::map<int, double>>& x) {
999 hash_.process_bytes(&(x.first), sizeof(double));
1000 Update(x.second);
1001 }
1002
1003 inline void Update(const std::map<std::string, std::pair<double, std::map<int, double>>>& x) {
1004 std::map<std::string, std::pair<double, std::map<int, double>>>::const_iterator it = x.begin();
1005 for (; it != x.end(); ++it) {
1006 hash_.process_bytes(&(it->first), it->first.size());
1007 Update(it->second);
1008 }
1009 }
1010
1011 inline void Update(const std::pair<int, std::pair<std::string, std::string>>& x) {
1012 hash_.process_bytes(&(x.first), sizeof(int));
1013 hash_.process_bytes(x.second.first.c_str(), x.second.first.size());
1014 hash_.process_bytes(x.second.second.c_str(), x.second.second.size());
1015 }
1016
1017 inline void Update(const std::vector<std::pair<int, std::pair<std::string, std::string>>>& x) {
1018 std::vector<std::pair<int, std::pair<std::string, std::string>>>::const_iterator it = x.begin();
1019 for (; it != x.end(); ++it) {
1020 Update(*it);
1021 }
1022 }
1023
1024 inline void Update(const std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>& x) {
1025 std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>::const_iterator it = x.begin();
1026 for (; it != x.end(); ++it) {
1027 hash_.process_bytes(it->first.c_str(), it->first.size());
1028 Update(it->second);
1029 }
1030 }
1031
1032 inline void Update(const std::list<std::pair<int, int>>& x){
1033 std::list<std::pair<int, int>>::const_iterator it = x.begin();
1034 for (; it != x.end(); ++it) {
1035 Update(*it);
1036 }
1037 }
1038
1039 inline void Update(const std::pair<std::string, std::vector<double>>& x) {
1040 hash_.process_bytes(x.first.c_str(), x.first.size());
1041 Update(x.second);
1042 }
1043
1044 inline void Update(const std::map<std::string, std::pair<std::string, std::vector<double>>>& x) {
1045 std::map<std::string, std::pair<std::string, std::vector<double>>>::const_iterator it = x.begin();
1046 for(; it != x.end(); ++it) {
1047 hash_.process_bytes(it->first.c_str(), it->first.size());
1048 Update(it->second);
1049 }
1050 }
1051
1052 inline void Update(const std::map<std::string, std::map<std::string, int>>& x) {
1053 std::map<std::string, std::map<std::string, int>>::const_iterator it = x.begin();
1054 for(; it != x.end(); ++it) {
1055 hash_.process_bytes(it->first.c_str(), it->first.size());
1056 Update(it->second);
1057 }
1058 }
1059
1060 inline void Update(const std::pair<double, double>& x) {
1061 hash_.process_bytes(&(x.first), sizeof(double));
1062 hash_.process_bytes(&(x.second), sizeof(double));
1063 }
1064
1065 inline void Update(const std::pair<std::pair<double, double>, std::map<std::string, double>>& x) {
1066 Update(x.first);
1067 Update(x.second);
1068 }
1069
1070 inline void Update(const std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>& x) {
1071 std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>::const_iterator it = x.begin();
1072 for(; it != x.end(); ++it) {
1073 Update(*it);
1074 }
1075 }
1076
1077 inline void Update(const std::map<std::string, std::map<std::string, double>>& x) {
1078 std::map<std::string, std::map<std::string, double>>::const_iterator it = x.begin();
1079 for(; it != x.end(); ++it) {
1080 hash_.process_bytes(it->first.c_str(), it->first.size());
1081 Update(it->second);
1082 }
1083 }
1084
1085 /// \}
1086
1088 Digest d;
1089 hash_.get_digest(d.val);
1090 return d;
1091 }
1092
1093 private:
1094 boost::uuids::detail::sha1 hash_;
1095};
1096
1097} // namespace cyclus
1098
1099#endif // CYCLUS_SRC_QUERY_BACKEND_H_
A type to represent variable-length array of bytes for dumping to a cyclus output database.
Definition blob.h:9
Wrapper class for QueryableBackends that injects a set of Cond's into every query before being execut...
virtual std::set< std::string > Tables()
Return a set of all table names currently in the database.
virtual std::map< std::string, DbTypes > ColumnTypes(std::string table)
Return a map of column names of the specified table to the associated database type.
CondInjector(QueryableBackend *b, std::vector< Cond > to_inject)
virtual QueryResult Query(std::string table, std::vector< Cond > *conds)
Return a set of rows from the specificed table that match all given conditions.
virtual std::list< ColumnInfo > Schema(std::string table)
Return information about all columns of a table.
Represents a condition used to filter rows returned by a query.
std::string op
One of: "<", ">", "<=", ">=", "==", "!=".
Cond(std::string field, std::string op, boost::spirit::hold_any val)
boost::spirit::hold_any val
value supported by backend(s) in use
CmpOpCode opcode
The CmpOpCode cooresponding to op.
std::string field
table column name
The digest type for SHA1s.
bool operator>=(const cyclus::Digest &rhs) const
bool operator!=(const cyclus::Digest &rhs) const
std::ostream & operator<<(std::ostream &out) const
std::vector< T > cast() const
Casts the value of this digest to a vector of the templated type.
bool operator>(const cyclus::Digest &rhs) const
bool operator<(const cyclus::Digest &rhs) const
bool operator<=(const cyclus::Digest &rhs) const
unsigned int val[CYCLUS_SHA1_NINT]
bool operator==(const cyclus::Digest &rhs) const
Interface implemented by backends that support recording and querying.
For failed retrieval/insertion of key-based data into/from data structures.
Definition error.h:47
Wrapper class for QueryableBackends that injects prefix in front of the title/table for every query b...
virtual std::list< ColumnInfo > Schema(std::string table)
Return information about all columns of a table.
virtual QueryResult Query(std::string table, std::vector< Cond > *conds)
Return a set of rows from the specificed table that match all given conditions.
virtual std::map< std::string, DbTypes > ColumnTypes(std::string table)
Return a map of column names of the specified table to the associated database type.
PrefixInjector(QueryableBackend *b, std::string prefix)
virtual std::set< std::string > Tables()
Return a set of all table names currently in the database.
Meta data and results of a query.
std::vector< QueryRow > rows
ordered results of a query
std::vector< DbTypes > types
types of each field returned by a query.
std::vector< std::string > fields
names of each field returned by a query
T GetVal(std::string field, int row=0)
Convenience method for retrieving a value from a specific row and named field (column).
Interface implemented by backends that support rudimentary querying.
virtual std::map< std::string, DbTypes > ColumnTypes(std::string table)=0
Return a map of column names of the specified table to the associated database type.
virtual std::list< ColumnInfo > Schema(std::string table)=0
Return information about all columns of a table.
virtual QueryResult Query(std::string table, std::vector< Cond > *conds)=0
Return a set of rows from the specificed table that match all given conditions.
virtual std::set< std::string > Tables()=0
Return a set of all table names currently in the database.
An abstract base class for listeners (e.g.
Definition rec_backend.h:16
void Update(const std::pair< std::string, std::vector< double > > &x)
void Update(const std::map< std::pair< std::string, std::string >, int > &x)
void Update(const std::map< int, std::map< std::string, double > > &x)
void Update(const std::map< std::string, cyclus::Blob > &x)
void Update(const std::map< std::string, double > &x)
void Update(const std::pair< double, std::map< int, double > > &x)
void Update(const Blob &b)
void Update(const std::set< std::string > &x)
void Update(const std::set< int > &x)
void Update(const std::list< cyclus::Blob > &x)
void Update(const std::set< double > &x)
void Update(const std::pair< double, double > &x)
void Update(const std::vector< int > &x)
void Update(const std::map< int, int > &x)
void Update(const std::list< std::pair< int, int > > &x)
void Update(const std::map< std::string, bool > &x)
void Update(const std::map< int, boost::uuids::uuid > &x)
void Update(const std::map< std::string, std::vector< std::pair< int, std::pair< std::string, std::string > > > > &x)
void Update(const std::pair< int, int > &x)
void Update(const std::pair< int, std::string > &x)
void Update(const std::set< float > &x)
void Update(const std::map< std::string, std::map< std::string, int > > &x)
void Update(const std::list< bool > &x)
void Update(const std::vector< double > &x)
void Update(const std::map< int, double > &x)
void Update(const std::map< int, float > &x)
void Update(const std::list< float > &x)
void Update(const std::vector< std::string > &x)
void Clear()
Clears the current hash value to its default state.
void Update(const std::map< std::string, float > &x)
void Update(const std::map< std::pair< int, std::string >, double > &x)
void Update(const std::map< std::string, std::map< int, double > > &x)
void Update(const std::list< std::string > &x)
void Update(const std::map< int, std::string > &x)
void Update(const std::list< boost::uuids::uuid > &x)
void Update(const std::map< std::string, std::vector< double > > &x)
void Update(const std::list< double > &x)
void Update(const std::map< int, bool > &x)
void Update(const std::list< int > &x)
void Update(const std::vector< boost::uuids::uuid > &x)
void Update(const std::pair< int, std::pair< std::string, std::string > > &x)
void Update(const std::vector< std::pair< std::pair< double, double >, std::map< std::string, double > > > &x)
void Update(const std::pair< std::pair< double, double >, std::map< std::string, double > > &x)
void Update(const std::vector< float > &x)
void Update(const std::set< cyclus::Blob > &x)
void Update(const std::map< std::string, std::map< std::string, double > > &x)
void Update(const std::map< std::string, int > &x)
void Update(const std::vector< cyclus::Blob > &x)
void Update(const std::set< bool > &x)
void Update(const std::map< int, cyclus::Blob > &x)
void Update(const std::set< boost::uuids::uuid > &x)
void Update(const std::map< std::string, std::pair< double, std::map< int, double > > > &x)
void Update(const std::map< std::string, std::pair< std::string, std::vector< double > > > &x)
void Update(const std::vector< std::pair< int, std::pair< std::string, std::string > > > &x)
void Update(const std::map< std::string, std::string > &x)
void Update(const std::string &s)
Updates the hash value in-place.
void Update(const std::map< std::string, boost::uuids::uuid > &x)
For failed object state expectations.
Definition error.h:53
For values that are too big, too small, etc.
Definition error.h:41
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
CmpOpCode
Represents operation codes for condition checking.
DbTypes
This is the primary list of all supported database types.
@ VL_SET_DOUBLE
@ PAIR_VL_STRING_VL_STRING
@ VL_MAP_STRING_VL_MAP_VL_STRING_DOUBLE
@ VL_LIST_STRING
@ VL_MAP_VL_STRING_MAP_STRING_INT
@ MAP_VL_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE
@ MAP_VL_STRING_INT
@ VL_MAP_STRING_MAP_INT_DOUBLE
@ VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_MAP_STRING_VECTOR_DOUBLE
@ VL_MAP_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE
@ PAIR_STRING_VECTOR_DOUBLE
@ PAIR_STRING_VL_VECTOR_DOUBLE
@ VL_MAP_VL_STRING_MAP_VL_STRING_DOUBLE
@ VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_STRING_DOUBLE
@ VL_MAP_STRING_FLOAT
@ MAP_STRING_PAIR_VL_STRING_VECTOR_DOUBLE
@ MAP_VL_STRING_PAIR_STRING_VECTOR_DOUBLE
@ MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ RES_BUF_MATERIAL
@ MAP_VL_STRING_DOUBLE
@ VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_VL_STRING_DOUBLE
@ MAP_STRING_UUID
@ MAP_VL_STRING_VL_STRING
@ VL_MAP_VL_STRING_MAP_STRING_DOUBLE
@ VL_MAP_VL_STRING_VL_STRING
@ VL_MAP_STRING_VL_MAP_INT_DOUBLE
@ MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ MAP_STRING_FLOAT
@ PAIR_INT_VL_STRING
@ PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_STRING_DOUBLE
@ VL_MAP_STRING_VL_VECTOR_DOUBLE
@ VL_MAP_VL_STRING_PAIR_VL_STRING_VECTOR_DOUBLE
@ PAIR_VL_STRING_VECTOR_DOUBLE
@ VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ PAIR_INT_FLOAT
@ MAP_STRING_STRING
@ RES_BUF_PRODUCT
@ VL_MAP_INT_BLOB
@ PAIR_DOUBLE_VL_MAP_INT_DOUBLE
@ MAP_STRING_MAP_STRING_DOUBLE
@ PAIR_STRING_STRING
@ VL_LIST_PAIR_INT_INT
@ VL_MAP_STRING_PAIR_VL_STRING_VECTOR_DOUBLE
@ VL_MAP_STRING_MAP_STRING_INT
@ MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ MAP_VL_STRING_BLOB
@ VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_STRING_DOUBLE
@ MAP_INT_VL_MAP_STRING_DOUBLE
@ VL_MAP_STRING_STRING
@ MAP_INT_MAP_STRING_DOUBLE
@ MAP_VL_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE
@ PAIR_INT_STRING
@ MAP_VL_STRING_STRING
@ VL_MAP_VL_STRING_VECTOR_DOUBLE
@ MAP_VL_STRING_UUID
@ MAP_STRING_BLOB
@ MAP_STRING_VECTOR_DOUBLE
@ RES_MAP_STRING_PRODUCT
@ PAIR_INT_PAIR_STRING_STRING
@ MAP_VL_STRING_FLOAT
@ VL_VECTOR_BOOL
@ MAP_PAIR_STRING_VL_STRING_INT
@ VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_STRING_DOUBLE
@ VL_MAP_VL_STRING_VL_MAP_VL_STRING_INT
@ VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_MAP_STRING_PAIR_STRING_VL_VECTOR_DOUBLE
@ VECTOR_PAIR_INT_PAIR_STRING_STRING
@ MAP_VL_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE
@ MAP_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE
@ VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ MAP_STRING_VL_MAP_STRING_INT
@ VL_MAP_INT_MAP_VL_STRING_DOUBLE
@ VL_VECTOR_FLOAT
@ MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ LIST_VL_STRING
@ PAIR_VL_STRING_BOOL
@ PAIR_VL_STRING_FLOAT
@ MAP_VL_STRING_VECTOR_DOUBLE
@ VL_MAP_VL_STRING_PAIR_STRING_VECTOR_DOUBLE
@ MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ MAP_VL_STRING_MAP_VL_STRING_INT
@ VL_MAP_STRING_INT
@ VL_MAP_STRING_VL_MAP_STRING_INT
@ VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ RES_MAP_INT_PRODUCT
@ VL_LIST_FLOAT
@ VL_MAP_PAIR_STRING_VL_STRING_INT
@ VL_MAP_STRING_MAP_VL_STRING_INT
@ VL_MAP_STRING_MAP_VL_STRING_DOUBLE
@ VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ VL_VECTOR_BLOB
@ MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_SET_STRING
@ VL_MAP_INT_FLOAT
@ VL_MAP_PAIR_VL_STRING_STRING_INT
@ VL_MAP_STRING_MAP_STRING_DOUBLE
@ SET_VL_STRING
@ PAIR_VL_STRING_BLOB
@ VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_VL_STRING_DOUBLE
@ VL_MAP_INT_BOOL
@ MAP_STRING_MAP_STRING_INT
@ VL_MAP_INT_VL_MAP_VL_STRING_DOUBLE
@ VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ MAP_VL_STRING_VL_MAP_VL_STRING_DOUBLE
@ MAP_PAIR_INT_STRING_DOUBLE
@ PAIR_STRING_FLOAT
@ PAIR_STRING_DOUBLE
@ PAIR_VL_STRING_DOUBLE
@ VL_MAP_INT_MAP_STRING_DOUBLE
@ VL_VECTOR_DOUBLE
@ VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_STRING_DOUBLE
@ PAIR_VL_STRING_INT
@ PAIR_INT_PAIR_VL_STRING_VL_STRING
@ MAP_STRING_VL_MAP_VL_STRING_INT
@ LIST_PAIR_INT_INT
@ VL_MAP_VL_STRING_BLOB
@ VL_MAP_VL_STRING_UUID
@ MAP_VL_STRING_PAIR_STRING_VL_VECTOR_DOUBLE
@ PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_VL_STRING_DOUBLE
@ MAP_VL_STRING_BOOL
@ VL_MAP_VL_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE
@ VL_MAP_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE
@ MAP_VL_STRING_VL_MAP_VL_STRING_INT
@ MAP_VL_STRING_VL_MAP_STRING_INT
@ MAP_STRING_MAP_VL_STRING_DOUBLE
@ VL_MAP_STRING_VL_STRING
@ VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ PAIR_DOUBLE_DOUBLE
@ PAIR_INT_BOOL
@ MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ VL_MAP_INT_DOUBLE
@ MAP_STRING_DOUBLE
@ PAIR_VL_STRING_UUID
@ VL_MAP_INT_STRING
@ PAIR_STRING_BOOL
@ VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ VL_MAP_STRING_BLOB
@ VL_MAP_INT_UUID
@ MAP_PAIR_STRING_STRING_INT
@ VL_VECTOR_UUID
@ MAP_PAIR_VL_STRING_VL_STRING_INT
@ MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ MAP_VL_STRING_MAP_VL_STRING_DOUBLE
@ MAP_STRING_VL_MAP_INT_DOUBLE
@ MAP_STRING_BOOL
@ PAIR_INT_PAIR_VL_STRING_STRING
@ VL_MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_MAP_INT_VL_STRING
@ VL_LIST_VL_STRING
@ VL_MAP_STRING_VL_MAP_STRING_DOUBLE
@ PAIR_STRING_BLOB
@ MAP_VL_STRING_VL_MAP_STRING_DOUBLE
@ VL_MAP_PAIR_INT_STRING_DOUBLE
@ VL_MAP_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE
@ VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ MAP_INT_MAP_VL_STRING_DOUBLE
@ VL_VECTOR_VL_STRING
@ PAIR_STRING_VL_STRING
@ PAIR_INT_DOUBLE
@ VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ RES_MAP_VL_STRING_PRODUCT
@ VL_MAP_STRING_PAIR_STRING_VECTOR_DOUBLE
@ MAP_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE
@ RES_MAP_INT_MATERIAL
@ MAP_VL_STRING_MAP_STRING_DOUBLE
@ MAP_VL_STRING_VL_MAP_INT_DOUBLE
@ MAP_VL_STRING_PAIR_VL_STRING_VECTOR_DOUBLE
@ MAP_STRING_PAIR_STRING_VECTOR_DOUBLE
@ VL_MAP_VL_STRING_PAIR_STRING_VL_VECTOR_DOUBLE
@ MAP_STRING_VL_MAP_VL_STRING_DOUBLE
@ VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_MAP_STRING_BOOL
@ MAP_STRING_PAIR_STRING_VL_VECTOR_DOUBLE
@ PAIR_STRING_UUID
@ MAP_PAIR_INT_VL_STRING_DOUBLE
@ VL_MAP_STRING_UUID
@ MAP_STRING_PAIR_VL_STRING_VL_VECTOR_DOUBLE
@ MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ PAIR_INT_BLOB
@ VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_VL_MAP_VL_STRING_DOUBLE
@ VL_MAP_VL_STRING_STRING
@ VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_MAP_VL_STRING_INT
@ VECTOR_STRING
@ VL_VECTOR_INT
@ VL_MAP_VL_STRING_PAIR_DOUBLE_MAP_INT_DOUBLE
@ VL_MAP_VL_STRING_MAP_VL_STRING_INT
@ VL_MAP_STRING_DOUBLE
@ VL_MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ PAIR_VL_STRING_STRING
@ VL_MAP_VL_STRING_VL_MAP_STRING_DOUBLE
@ VL_MAP_VL_STRING_PAIR_DOUBLE_VL_MAP_INT_DOUBLE
@ VECTOR_DOUBLE
@ MAP_STRING_MAP_INT_DOUBLE
@ MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_VL_STRING
@ VL_MAP_VL_STRING_VL_MAP_INT_DOUBLE
@ VL_MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_VL_STRING_STRING
@ VL_MAP_INT_VL_MAP_STRING_DOUBLE
@ VL_MAP_STRING_VL_MAP_VL_STRING_INT
@ VL_MAP_PAIR_VL_STRING_VL_STRING_INT
@ VL_MAP_VL_STRING_DOUBLE
@ VL_MAP_PAIR_INT_VL_STRING_DOUBLE
@ VL_MAP_VL_STRING_VL_VECTOR_DOUBLE
@ MAP_VL_STRING_MAP_STRING_INT
@ MAP_INT_VL_MAP_VL_STRING_DOUBLE
@ VL_LIST_DOUBLE
@ MAP_VL_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ RES_MAP_STRING_MATERIAL
@ VL_MAP_VL_STRING_FLOAT
@ VECTOR_VL_STRING
@ VL_VECTOR_PAIR_PAIR_DOUBLE_DOUBLE_MAP_VL_STRING_DOUBLE
@ MAP_STRING_VL_MAP_STRING_DOUBLE
@ VL_MAP_VL_STRING_BOOL
@ MAP_VL_STRING_VL_VECTOR_DOUBLE
@ VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ MAP_PAIR_VL_STRING_STRING_INT
@ PAIR_INT_PAIR_STRING_VL_STRING
@ VL_MAP_VL_STRING_VL_MAP_STRING_INT
@ MAP_STRING_VL_VECTOR_DOUBLE
@ PAIR_DOUBLE_MAP_INT_DOUBLE
@ MAP_STRING_MAP_VL_STRING_INT
@ VL_MAP_VL_STRING_MAP_INT_DOUBLE
@ VL_SET_VL_STRING
@ VL_VECTOR_STRING
@ MAP_STRING_VL_STRING
@ MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ PAIR_PAIR_DOUBLE_DOUBLE_MAP_VL_STRING_DOUBLE
@ VL_MAP_VL_STRING_VL_MAP_VL_STRING_DOUBLE
@ VL_MAP_STRING_VECTOR_PAIR_INT_PAIR_STRING_VL_STRING
@ MAP_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ MAP_VL_STRING_MAP_INT_DOUBLE
@ MAP_VL_STRING_VL_VECTOR_PAIR_INT_PAIR_STRING_STRING
@ PAIR_STRING_INT
@ RES_MAP_VL_STRING_MATERIAL
@ PAIR_PAIR_DOUBLE_DOUBLE_MAP_STRING_DOUBLE
@ VL_MAP_PAIR_STRING_STRING_INT
@ MAP_INT_VL_STRING
@ PAIR_VL_STRING_VL_VECTOR_DOUBLE
std::vector< boost::spirit::hold_any > QueryRow
bool CmpCond(T *x, Cond *cond)
Compares a condiontion for a single value.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
bool CmpConds(T *x, std::vector< Cond * > *conds)
Compares all condiontions for a value.
#define CYCLUS_UUID_SIZE
#define CYCLUS_SHA1_NINT
Represents column information.
ColumnInfo(std::string default_table, std::string default_col, int default_index, DbTypes default_dbtype, std::vector< int > default_shape)
std::vector< int > shape