CYCLUS
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 
24 namespace cyclus {
25 
26 /// This is the master 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.
31 enum 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  RESOURCE_BUFF, // ["cyclus::toolkit::ResourceBuff", 0, [], "RESOURCE_BUFF", false]
317  RES_BUF_MATERIAL, // ["cyclus::toolkit::ResBuf<cyclus::Material>", 1, [], ["RES_BUF", "MATERIAL"], false]
318  RES_BUF_PRODUCT, // ["cyclus::toolkit::ResBuf<cyclus::Product>", 1, [], ["RES_BUF", "PRODUCT"], false]
319  RES_MAP_INT_MATERIAL, // ["cyclus::toolkit::ResMap<int, cyclus::Material>", 2, [], ["RES_MAP", "INT", "MATERIAL"], false]
320  RES_MAP_INT_PRODUCT, // ["cyclus::toolkit::ResMap<int, cyclus::Product>", 2, [], ["RES_MAP", "INT", "PRODUCT"], false]
321  RES_MAP_STRING_MATERIAL, // ["cyclus::toolkit::ResMap<std::string, cyclus::Material>", 2, [], ["RES_MAP", "STRING", "MATERIAL"], false]
322  RES_MAP_STRING_PRODUCT, // ["cyclus::toolkit::ResMap<std::string, cyclus::Product>", 2, [], ["RES_MAP", "STRING", "PRODUCT"], false]
323  RES_MAP_VL_STRING_MATERIAL, // ["cyclus::toolkit::ResMap<std::string, cyclus::Material>", 2, [], ["RES_MAP", "VL_STRING", "MATERIAL"], false]
324  RES_MAP_VL_STRING_PRODUCT, // ["cyclus::toolkit::ResMap<std::string, cyclus::Product>", 2, [], ["RES_MAP", "VL_STRING", "PRODUCT"], false]
325 
326  // pair<double, map<int, double>>
327  PAIR_DOUBLE_MAP_INT_DOUBLE, // ["std::pair<double, std::map<int, double>>", 2, ["HDF5"], ["PAIR", "DOUBLE", ["MAP", "INT", "DOUBLE"]], false]
328  PAIR_DOUBLE_VL_MAP_INT_DOUBLE, // ["std::pair<double, std::map<int, double>>", 2, ["HDF5"], ["PAIR", "DOUBLE", ["VL_MAP", "INT", "DOUBLE"]], false]
329 
330  // vector<pair<int, pair<string, string>>>
331  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]
332  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]
333  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]
334  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]
335  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]
336  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]
337  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]
338  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]
339 
340  PAIR_STRING_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "STRING", ["VECTOR", "DOUBLE"]], false]
341  PAIR_VL_STRING_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "VL_STRING", ["VECTOR", "DOUBLE"]], false]
342  PAIR_STRING_VL_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "STRING", ["VL_VECTOR", "DOUBLE"]], false]
343  PAIR_VL_STRING_VL_VECTOR_DOUBLE, // ["std::pair<std::string, std::vector<double>>", 1, ["HDF5"], ["PAIR", "VL_STRING", ["VL_VECTOR", "DOUBLE"]], false]
344 
345  //map<pair<string, string>, int>
346  MAP_PAIR_STRING_STRING_INT, // ["std::map<std::pair<std::string, std::string>, int>", 4, ["HDF5","SQLite"], ["MAP", ["PAIR", "STRING", "STRING"], "INT"], false]
347  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]
348  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]
349  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]
350  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]
351  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]
352  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]
353  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]
354 
355  // map<string, map<string, double> >
356  MAP_STRING_MAP_STRING_DOUBLE, // ["std::map<std::string, std::map<std::string, double>>", 4, ["HDF5", "SQLite"], ["MAP", "STRING", ["MAP", "STRING", "DOUBLE"]], false]
357  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]
358  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]
359  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]
360  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]
361  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]
362  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]
363  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]
364  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]
365  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]
366  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]
367  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]
368  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]
369  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]
370  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]
371  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]
372  // append new types only:
373 };
374 
375 /// Represents operation codes for condition checking.
376 enum CmpOpCode {
377  LT = 0,
378  GT,
379  LE,
380  GE,
381  EQ,
382  NE,
383 };
384 
385 /// Represents a condition used to filter rows returned by a query.
386 class Cond {
387  public:
388  Cond() {}
389 
391  : field(field),
392  op(op),
393  val(val) {
394  if (op == "<")
395  opcode = LT;
396  else if (op == ">")
397  opcode = GT;
398  else if (op == "<=")
399  opcode = LE;
400  else if (op == ">=")
401  opcode = GE;
402  else if (op == "==")
403  opcode = EQ;
404  else if (op == "!=")
405  opcode = NE;
406  else
407  throw ValueError("operation '" + op + "' not valid for field '" + \
408  field + "'.");
409  }
410 
411  /// table column name
413 
414  /// One of: "<", ">", "<=", ">=", "==", "!="
416 
417  /// The CmpOpCode cooresponding to op.
419 
420  /// value supported by backend(s) in use
422 };
423 
424 typedef std::vector<boost::spirit::hold_any> QueryRow;
425 
426 /// Meta data and results of a query.
427 class QueryResult {
428  public:
429  /// names of each field returned by a query
430  std::vector<std::string> fields;
431 
432  /// types of each field returned by a query.
433  std::vector<DbTypes> types;
434 
435  /// ordered results of a query
436  std::vector<QueryRow> rows;
437 
438  void Reset() {
439  fields.clear();
440  types.clear();
441  rows.clear();
442  }
443 
444  /// Convenience method for retrieving a value from a specific row and named
445  /// field (column). The caller is responsible for specifying a valid templated
446  /// type to cast to. Example use:
447  ///
448  /// @code
449  ///
450  /// QueryResult qr = ...
451  ///
452  /// for (int i = 0; i < qr.rows.size(); ++i) {
453  /// std::cout << qr.GetVal<int>("field1", i) << "\n";
454  /// std::cout << qr.GetVal<double>("field2", i) << "\n";
455  /// std::cout << qr.GetVal<std::string>("field3", i) << "\n";
456  /// }
457  ///
458  /// @endcode
459  template <class T>
460  T GetVal(std::string field, int row = 0) {
461  if (rows.empty())
462  throw StateError("No rows found during query for field " + field);
463 
464  if (row >= rows.size()) {
465  throw KeyError("index larger than number of query rows for field "
466  + field);
467  }
468 
469  int field_idx = -1;
470  for (int i = 0; i < fields.size(); ++i) {
471  if (fields[i] == field) {
472  field_idx = i;
473  break;
474  }
475  }
476  if (field_idx == -1) {
477  throw KeyError("query result has no such field " + field);
478  }
479 
480  return rows[row][field_idx].cast<T>();
481  }
482 };
483 
484 /// Represents column information.
485 struct ColumnInfo {
487  ColumnInfo(std::string default_table, std::string default_col, int default_index,
488  DbTypes default_dbtype, std::vector<int> default_shape) :
489  table(default_table), col(default_col), index(default_index), dbtype(default_dbtype),
490  shape(default_shape) {};
493  int index;
495  std::vector<int> shape;
496 };
497 
498 /// Interface implemented by backends that support rudimentary querying.
500  public:
501  virtual ~QueryableBackend() {}
502 
503  /// Return a set of rows from the specificed table that match all given
504  /// conditions. Conditions are AND'd together. conds may be NULL.
505  virtual QueryResult Query(std::string table, std::vector<Cond>* conds) = 0;
506 
507  /// Return a map of column names of the specified table to the associated
508  /// database type.
509  virtual std::map<std::string, DbTypes> ColumnTypes(std::string table) = 0;
510 
511  /// Return information about all columns of a table.
512  virtual std::list<ColumnInfo> Schema(std::string table) = 0;
513 
514  /// Return a set of all table names currently in the database.
515  virtual std::set<std::string> Tables() = 0;
516 };
517 
518 /// Interface implemented by backends that support recording and querying.
519 class FullBackend: public QueryableBackend, public RecBackend {
520  public:
521  virtual ~FullBackend() {}
522 };
523 
524 /// Wrapper class for QueryableBackends that injects a set of Cond's into every
525 /// query before being executed.
527  public:
528  CondInjector(QueryableBackend* b, std::vector<Cond> to_inject)
529  : b_(b),
530  to_inject_(to_inject) {}
531 
532  virtual QueryResult Query(std::string table, std::vector<Cond>* conds) {
533  if (conds == NULL) {
534  return b_->Query(table, &to_inject_);
535  }
536 
537  std::vector<Cond> c = *conds;
538  for (int i = 0; i < to_inject_.size(); ++i) {
539  c.push_back(to_inject_[i]);
540  }
541  return b_->Query(table, &c);
542  }
543 
544  virtual std::map<std::string, DbTypes> ColumnTypes(std::string table) {
545  return b_->ColumnTypes(table);
546  }
547 
548  virtual std::list<ColumnInfo> Schema(std::string table) {
549  return b_->Schema(table);
550  }
551 
552  virtual std::set<std::string> Tables() { return b_->Tables(); }
553 
554  private:
555  QueryableBackend* b_;
556  std::vector<Cond> to_inject_;
557 };
558 
559 /// Wrapper class for QueryableBackends that injects prefix in front of the
560 /// title/table for every query before being executed. A query to the
561 /// "MyAgentTable" table will actually be passed to the wrapped backend as
562 /// [prefix] + "MyAgentTable".
564  public:
566  : b_(b),
567  prefix_(prefix) {}
568 
569  virtual QueryResult Query(std::string table, std::vector<Cond>* conds) {
570  return b_->Query(prefix_ + table, conds);
571  }
572 
573  virtual std::map<std::string, DbTypes> ColumnTypes(std::string table) {
574  return b_->ColumnTypes(table);
575  }
576 
577  virtual std::list<ColumnInfo> Schema(std::string table) {
578  return b_->Schema(table);
579  }
580 
581  virtual std::set<std::string> Tables() { return b_->Tables(); }
582 
583  private:
584  QueryableBackend* b_;
585  std::string prefix_;
586 };
587 
588 /// Compares a condiontion for a single value
589 template <typename T>
590 inline bool CmpCond(T* x, Cond* cond) {
591  bool rtn;
592  switch (cond->opcode) {
593  case LT: {
594  rtn = (*x) < cond->val.cast<T>();
595  break;
596  }
597  case GT: {
598  rtn = (*x) > cond->val.cast<T>();
599  break;
600  }
601  case LE: {
602  rtn = (*x) <= cond->val.cast<T>();
603  break;
604  }
605  case GE: {
606  rtn = (*x) >= cond->val.cast<T>();
607  break;
608  }
609  case EQ: {
610  rtn = (*x) == cond->val.cast<T>();
611  break;
612  }
613  case NE: {
614  rtn = (*x) != cond->val.cast<T>();
615  break;
616  }
617  }
618  return rtn;
619 }
620 
621 /// Compares all condiontions for a value
622 template <typename T>
623 inline bool CmpConds(T* x, std::vector<Cond*>* conds) {
624  int i;
625  for (i = 0; i < conds->size(); ++i)
626  if (!CmpCond<T>(&(*x), (*conds)[i]))
627  return false;
628  return true;
629 }
630 
631 /// The digest type for SHA1s.
632 ///
633 /// This class is a hack around a language deficiency in C++. You cannot pass
634 /// around an array (unsinged int[5]) between function calls. You can only
635 /// pass pointers, which would involve lost of new/free and heap shenanigans
636 /// that are not needed for a dumb container. Therefore Sha1::Digest() cannot
637 /// return what would be most natural. The second most natural thing would be
638 /// a std::array<unsigned int, 5>. However, std::array is a C++11 feature and
639 /// we are not yet ready to go down that road.
640 ///
641 /// To pass an array into and out of a function it has to be inside of struct
642 /// or a class. I chose a class here since there are many member functions.
643 ///
644 /// The reason why this is public is that it needs to be directly writable
645 /// from buffers coming from HDF5. In the future, this really should just be
646 /// a std::array.
647 class Digest {
648  public:
649  unsigned int val[CYCLUS_SHA1_NINT];
650 
651  /// Casts the value of this digest to a vector of the templated type.
652  template <typename T>
653  inline std::vector<T> cast() const {
654  std::vector<T> rtn = std::vector<T>(CYCLUS_SHA1_NINT);
655  for (unsigned int i = 0; i < CYCLUS_SHA1_NINT; ++i)
656  rtn[i] = static_cast<T>(val[i]);
657  return rtn;
658  }
659 
660  // operators
661  inline std::ostream& operator<<(std::ostream& out) const {
662  return out << "[" << val[0] << ", " << val[1] << ", " << val[2] << \
663  ", " << val[3] << ", " << val[4] << "]";
664  }
665 
666  inline bool operator< (const cyclus::Digest& rhs) const {
667  bool rtn = false;
668  for (int i = 0; i < CYCLUS_SHA1_NINT; ++i) {
669  if (val[i] < rhs.val[i]) {
670  rtn = true;
671  break;
672  } else if (val[i] > rhs.val[i]) {
673  rtn = false;
674  break;
675  } // else they are equal and we need to check the next index
676  }
677  return rtn;
678  }
679 
680  inline bool operator> (const cyclus::Digest& rhs) const {
681  return !operator<(rhs) && !operator==(rhs);
682  }
683 
684  inline bool operator<=(const cyclus::Digest& rhs) const {
685  return !operator>(rhs);
686  }
687 
688  inline bool operator>=(const cyclus::Digest& rhs) const {
689  return !operator<(rhs);
690  }
691 
692  inline bool operator==(const cyclus::Digest& rhs) const {
693  bool rtn = true;
694  for (int i = 0; i < CYCLUS_SHA1_NINT; ++i) {
695  if (val[i] != rhs.val[i]) {
696  rtn = false;
697  break;
698  } // else they are equal and we need to check the next index.
699  }
700  return rtn;
701  }
702 
703  inline bool operator!=(const cyclus::Digest& rhs) const {
704  return !operator==(rhs);
705  }
706 };
707 
708 class Sha1 {
709  public:
710  Sha1() { hash_ = boost::uuids::detail::sha1(); }
711 
712  /// Clears the current hash value to its default state.
713  inline void Clear() { hash_.reset(); }
714 
715  /// Updates the hash value in-place.
716  /// \{
717  inline void Update(const std::string& s) {
718  hash_.process_bytes(s.c_str(), s.size());
719  }
720 
721  inline void Update(const Blob& b) { Update(b.str()); }
722 
723  inline void Update(const std::vector<int>& x) {
724  hash_.process_bytes(&x[0], x.size() * sizeof(int));
725  }
726 
727  inline void Update(const std::vector<float>& x) {
728  hash_.process_bytes(&x[0], x.size() * sizeof(float));
729  }
730 
731  inline void Update(const std::vector<double>& x) {
732  hash_.process_bytes(&x[0], x.size() * sizeof(double));
733  }
734 
735  inline void Update(const std::vector<std::string>& x) {
736  for (unsigned int i = 0; i < x.size(); ++i)
737  hash_.process_bytes(x[i].c_str(), x[i].size());
738  }
739 
740  inline void Update(const std::vector<cyclus::Blob>& x) {
741  for (unsigned int i = 0; i < x.size(); ++i)
742  hash_.process_bytes(x[i].str().c_str(), x[i].str().size());
743  }
744 
745  inline void Update(const std::vector<boost::uuids::uuid>& x) {
746  std::vector<boost::uuids::uuid>::const_iterator it = x.begin();
747  for (; it != x.end(); ++it)
748  hash_.process_bytes(&(*it), CYCLUS_UUID_SIZE);
749  }
750 
751  inline void Update(const std::set<int>& x) {
752  std::set<int>::iterator it = x.begin();
753  for (; it != x.end(); ++it)
754  hash_.process_bytes(&(*it), sizeof(int));
755  }
756 
757  inline void Update(const std::set<bool>& x) {
758  std::set<bool>::iterator it = x.begin();
759  for (; it != x.end(); ++it)
760  hash_.process_bytes(&(*it), sizeof(bool));
761  }
762 
763  inline void Update(const std::set<double>& x) {
764  std::set<double>::iterator it = x.begin();
765  for (; it != x.end(); ++it)
766  hash_.process_bytes(&(*it), sizeof(double));
767  }
768 
769  inline void Update(const std::set<float>& x) {
770  std::set<float>::iterator it = x.begin();
771  for (; it != x.end(); ++it)
772  hash_.process_bytes(&(*it), sizeof(float));
773  }
774 
775  inline void Update(const std::set<cyclus::Blob>& x) {
776  std::set<cyclus::Blob>::iterator it = x.begin();
777  for (; it != x.end(); ++it)
778  hash_.process_bytes(it->str().c_str(), it->str().size());
779  }
780 
781  inline void Update(const std::set<boost::uuids::uuid>& x) {
782  std::set<boost::uuids::uuid>::iterator it = x.begin();
783  for (; it != x.end(); ++it)
784  hash_.process_bytes(&(*it), CYCLUS_UUID_SIZE);
785  }
786 
787  inline void Update(const std::set<std::string>& x) {
788  std::set<std::string>::iterator it = x.begin();
789  for (; it != x.end(); ++it)
790  hash_.process_bytes(it->c_str(), it->size());
791  }
792 
793  inline void Update(const std::list<int>& x) {
794  std::list<int>::const_iterator it = x.begin();
795  for (; it != x.end(); ++it)
796  hash_.process_bytes(&(*it), sizeof(int));
797  }
798 
799  inline void Update(const std::list<bool>& x) {
800  std::list<bool>::const_iterator it = x.begin();
801  for (; it != x.end(); ++it)
802  hash_.process_bytes(&(*it), sizeof(bool));
803  }
804 
805  inline void Update(const std::list<double>& x) {
806  std::list<double>::const_iterator it = x.begin();
807  for (; it != x.end(); ++it)
808  hash_.process_bytes(&(*it), sizeof(double));
809  }
810 
811  inline void Update(const std::list<float>& x) {
812  std::list<float>::const_iterator it = x.begin();
813  for (; it != x.end(); ++it)
814  hash_.process_bytes(&(*it), sizeof(float));
815  }
816 
817  inline void Update(const std::list<std::string>& x) {
818  std::list<std::string>::const_iterator it = x.begin();
819  for (; it != x.end(); ++it)
820  hash_.process_bytes(it->c_str(), it->size());
821  }
822 
823  inline void Update(const std::list<cyclus::Blob>& x) {
824  std::list<cyclus::Blob>::const_iterator it = x.begin();
825  for (; it != x.end(); ++it)
826  hash_.process_bytes(it->str().c_str(), it->str().size());
827  }
828 
829  inline void Update(const std::list<boost::uuids::uuid>& x) {
830  std::list<boost::uuids::uuid>::const_iterator it = x.begin();
831  for (; it != x.end(); ++it)
832  hash_.process_bytes(&(*it), CYCLUS_UUID_SIZE);
833  }
834 
835  inline void Update(const std::pair<int, int>& x) {
836  hash_.process_bytes(&(x.first), sizeof(int));
837  hash_.process_bytes(&(x.second), sizeof(int));
838  }
839 
840  inline void Update(const std::pair<int, std::string>& x) {
841  hash_.process_bytes(&(x.first), sizeof(int));
842  hash_.process_bytes(x.second.c_str(), x.second.size());
843  }
844 
845  inline void Update(const std::map<int, int>& x) {
846  std::map<int, int>::const_iterator it = x.begin();
847  for (; it != x.end(); ++it) {
848  hash_.process_bytes(&(it->first), sizeof(int));
849  hash_.process_bytes(&(it->second), sizeof(int));
850  }
851  }
852 
853  inline void Update(const std::map<int, bool>& x) {
854  std::map<int, bool>::const_iterator it = x.begin();
855  for (; it != x.end(); ++it) {
856  hash_.process_bytes(&(it->first), sizeof(int));
857  hash_.process_bytes(&(it->second), sizeof(bool));
858  }
859  }
860 
861  inline void Update(const std::map<int, double>& x) {
862  std::map<int, double>::const_iterator it = x.begin();
863  for (; it != x.end(); ++it) {
864  hash_.process_bytes(&(it->first), sizeof(int));
865  hash_.process_bytes(&(it->second), sizeof(double));
866  }
867  }
868 
869  inline void Update(const std::map<int, float>& x) {
870  std::map<int, float>::const_iterator it = x.begin();
871  for (; it != x.end(); ++it) {
872  hash_.process_bytes(&(it->first), sizeof(int));
873  hash_.process_bytes(&(it->second), sizeof(float));
874  }
875  }
876 
877  inline void Update(const std::map<int, cyclus::Blob>& x) {
878  std::map<int, cyclus::Blob>::const_iterator it = x.begin();
879  for (; it != x.end(); ++it) {
880  hash_.process_bytes(&(it->first), sizeof(int));
881  hash_.process_bytes(it->second.str().c_str(), it->second.str().size());
882  }
883  }
884 
885  inline void Update(const std::map<int, boost::uuids::uuid>& x) {
886  std::map<int, boost::uuids::uuid>::const_iterator it = x.begin();
887  for (; it != x.end(); ++it) {
888  hash_.process_bytes(&(it->first), sizeof(int));
889  hash_.process_bytes(&(it->second), CYCLUS_UUID_SIZE);
890  }
891  }
892 
893  inline void Update(const std::map<int, std::string>& x) {
894  std::map<int, std::string>::const_iterator it = x.begin();
895  for (; it != x.end(); ++it) {
896  hash_.process_bytes(&(it->first), sizeof(int));
897  hash_.process_bytes(it->second.c_str(), it->second.size());
898  }
899  }
900 
901  inline void Update(const std::map<std::string, int>& x) {
902  std::map<std::string, int>::const_iterator it = x.begin();
903  for (; it != x.end(); ++it) {
904  hash_.process_bytes(it->first.c_str(), it->first.size());
905  hash_.process_bytes(&(it->second), sizeof(int));
906  }
907  }
908 
909  inline void Update(const std::map<std::string, double>& x) {
910  std::map<std::string, double>::const_iterator it = x.begin();
911  for (; it != x.end(); ++it) {
912  hash_.process_bytes(it->first.c_str(), it->first.size());
913  hash_.process_bytes(&(it->second), sizeof(double));
914  }
915  }
916 
917  inline void Update(const std::map<std::string, float>& x) {
918  std::map<std::string, float>::const_iterator it = x.begin();
919  for (; it != x.end(); ++it) {
920  hash_.process_bytes(it->first.c_str(), it->first.size());
921  hash_.process_bytes(&(it->second), sizeof(float));
922  }
923  }
924 
925  inline void Update(const std::map<std::string, bool>& x) {
926  std::map<std::string, bool>::const_iterator it = x.begin();
927  for (; it != x.end(); ++it) {
928  hash_.process_bytes(it->first.c_str(), it->first.size());
929  hash_.process_bytes(&(it->second), sizeof(bool));
930  }
931  }
932 
933  inline void Update(const std::map<std::string, cyclus::Blob>& x) {
934  std::map<std::string, cyclus::Blob>::const_iterator it = x.begin();
935  for (; it != x.end(); ++it) {
936  hash_.process_bytes(it->first.c_str(), it->first.size());
937  hash_.process_bytes(it->second.str().c_str(), it->second.str().size());
938  }
939  }
940 
941  inline void Update(const std::map<std::string, boost::uuids::uuid>& x) {
942  std::map<std::string, boost::uuids::uuid>::const_iterator it = x.begin();
943  for (; it != x.end(); ++it) {
944  hash_.process_bytes(it->first.c_str(), it->first.size());
945  hash_.process_bytes(&(it->second), CYCLUS_UUID_SIZE);
946  }
947  }
948 
949  inline void Update(const std::map<std::string, std::string>& x) {
950  std::map<std::string, std::string>::const_iterator it = x.begin();
951  for (; it != x.end(); ++it) {
952  hash_.process_bytes(it->first.c_str(), it->first.size());
953  hash_.process_bytes(it->second.c_str(), it->second.size());
954  }
955  }
956 
957  inline void Update(const std::map<std::pair<int, std::string>, double>& x) {
958  std::map<std::pair<int, std::string>, double>::const_iterator it = x.begin();
959  for (; it != x.end(); ++it) {
960  hash_.process_bytes(&(it->first.first), sizeof(int));
961  hash_.process_bytes(it->first.second.c_str(), it->first.second.size());
962  hash_.process_bytes(&(it->second), sizeof(double));
963  }
964  }
965 
966  inline void Update(const std::map<std::pair<std::string, std::string>, int>& x) {
967  std::map<std::pair<std::string, std::string>, int>::const_iterator it = x.begin();
968  for (; it != x.end(); ++it) {
969  hash_.process_bytes(it->first.first.c_str(), it->first.first.size());
970  hash_.process_bytes(it->first.second.c_str(), it->first.second.size());
971  hash_.process_bytes(&(it->second), sizeof(int));
972  }
973  }
974 
975  inline void Update(const std::map<std::string, std::vector<double>>& x) {
976  std::map<std::string, std::vector<double>>::const_iterator it = x.begin();
977  for (; it != x.end(); ++it) {
978  hash_.process_bytes(it->first.c_str(), it->first.size());
979  Update(it->second);
980  }
981  }
982 
983  inline void Update(const std::map<std::string, std::map<int, double>>& x) {
984  std::map<std::string, std::map<int, double>>::const_iterator it = x.begin();
985  for (; it != x.end(); ++it) {
986  hash_.process_bytes(it->first.c_str(), it->first.size());
987  Update(it->second);
988  }
989  }
990 
991  inline void Update(const std::map<int, std::map<std::string, double>>& x) {
992  std::map<int, std::map<std::string, double>>::const_iterator it = x.begin();
993  for (; it != x.end(); ++it) {
994  hash_.process_bytes(&(it->first), sizeof(int));
995  Update(it->second);
996  }
997  }
998 
999  inline void Update(const std::pair<double, std::map<int, double>>& x) {
1000  hash_.process_bytes(&(x.first), sizeof(double));
1001  Update(x.second);
1002  }
1003 
1004  inline void Update(const std::map<std::string, std::pair<double, std::map<int, double>>>& x) {
1005  std::map<std::string, std::pair<double, std::map<int, double>>>::const_iterator it = x.begin();
1006  for (; it != x.end(); ++it) {
1007  hash_.process_bytes(&(it->first), it->first.size());
1008  Update(it->second);
1009  }
1010  }
1011 
1012  inline void Update(const std::pair<int, std::pair<std::string, std::string>>& x) {
1013  hash_.process_bytes(&(x.first), sizeof(int));
1014  hash_.process_bytes(x.second.first.c_str(), x.second.first.size());
1015  hash_.process_bytes(x.second.second.c_str(), x.second.second.size());
1016  }
1017 
1018  inline void Update(const std::vector<std::pair<int, std::pair<std::string, std::string>>>& x) {
1019  std::vector<std::pair<int, std::pair<std::string, std::string>>>::const_iterator it = x.begin();
1020  for (; it != x.end(); ++it) {
1021  Update(*it);
1022  }
1023  }
1024 
1025  inline void Update(const std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>& x) {
1026  std::map<std::string, std::vector<std::pair<int, std::pair<std::string, std::string>>>>::const_iterator it = x.begin();
1027  for (; it != x.end(); ++it) {
1028  hash_.process_bytes(it->first.c_str(), it->first.size());
1029  Update(it->second);
1030  }
1031  }
1032 
1033  inline void Update(const std::list<std::pair<int, int>>& x){
1034  std::list<std::pair<int, int>>::const_iterator it = x.begin();
1035  for (; it != x.end(); ++it) {
1036  Update(*it);
1037  }
1038  }
1039 
1040  inline void Update(const std::pair<std::string, std::vector<double>>& x) {
1041  hash_.process_bytes(x.first.c_str(), x.first.size());
1042  Update(x.second);
1043  }
1044 
1045  inline void Update(const std::map<std::string, std::pair<std::string, std::vector<double>>>& x) {
1046  std::map<std::string, std::pair<std::string, std::vector<double>>>::const_iterator it = x.begin();
1047  for(; it != x.end(); ++it) {
1048  hash_.process_bytes(it->first.c_str(), it->first.size());
1049  Update(it->second);
1050  }
1051  }
1052 
1053  inline void Update(const std::map<std::string, std::map<std::string, int>>& x) {
1054  std::map<std::string, std::map<std::string, int>>::const_iterator it = x.begin();
1055  for(; it != x.end(); ++it) {
1056  hash_.process_bytes(it->first.c_str(), it->first.size());
1057  Update(it->second);
1058  }
1059  }
1060 
1061  inline void Update(const std::pair<double, double>& x) {
1062  hash_.process_bytes(&(x.first), sizeof(double));
1063  hash_.process_bytes(&(x.second), sizeof(double));
1064  }
1065 
1066  inline void Update(const std::pair<std::pair<double, double>, std::map<std::string, double>>& x) {
1067  Update(x.first);
1068  Update(x.second);
1069  }
1070 
1071  inline void Update(const std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>& x) {
1072  std::vector<std::pair<std::pair<double, double>, std::map<std::string, double>>>::const_iterator it = x.begin();
1073  for(; it != x.end(); ++it) {
1074  Update(*it);
1075  }
1076  }
1077 
1078  inline void Update(const std::map<std::string, std::map<std::string, double>>& x) {
1079  std::map<std::string, std::map<std::string, double>>::const_iterator it = x.begin();
1080  for(; it != x.end(); ++it) {
1081  hash_.process_bytes(it->first.c_str(), it->first.size());
1082  Update(it->second);
1083  }
1084  }
1085 
1086  /// \}
1087 
1089  Digest d;
1090  hash_.get_digest(d.val);
1091  return d;
1092  }
1093 
1094  private:
1095  boost::uuids::detail::sha1 hash_;
1096 };
1097 
1098 } // namespace cyclus
1099 
1100 #endif // CYCLUS_SRC_QUERY_BACKEND_H_
T Query(InfileTree *tree, std::string query, int index=0)
a query method for required parameters
Definition: infile_tree.h:84
void Update(const std::map< std::pair< int, std::string >, double > &x)
unsigned int val[CYCLUS_SHA1_NINT]
void Update(const std::map< std::string, int > &x)
void Update(const Blob &b)
void Update(const std::map< int, double > &x)
bool CmpConds(T *x, std::vector< Cond *> *conds)
Compares all condiontions for a value.
std::string op
One of: "<", ">", "<=", ">=", "==", "!=".
void Update(const std::pair< std::string, std::vector< double >> &x)
void Update(const std::map< int, int > &x)
virtual QueryResult Query(std::string table, std::vector< Cond > *conds)
Return a set of rows from the specificed table that match all given conditions.
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
Definition: pyne.cc:11180
void Update(const std::map< std::string, bool > &x)
For failed object state expectations.
Definition: error.h:53
CondInjector(QueryableBackend *b, std::vector< Cond > to_inject)
Interface implemented by backends that support recording and querying.
Meta data and results of a query.
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.
bool operator<(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint comparison operator, allows usage in ordered containers...
void Update(const std::list< double > &x)
void Update(const std::vector< std::string > &x)
ColumnInfo(std::string default_table, std::string default_col, int default_index, DbTypes default_dbtype, std::vector< int > default_shape)
boost::spirit::hold_any val
value supported by backend(s) in use
For values that are too big, too small, etc.
Definition: error.h:41
void Update(const std::map< std::string, std::pair< double, std::map< int, double >>> &x)
bool operator<=(const cyclus::Digest &rhs) const
void Update(const std::pair< int, int > &x)
void Update(const std::list< bool > &x)
void Update(const std::pair< int, std::string > &x)
void Update(const std::map< std::string, float > &x)
bool operator>=(const cyclus::Digest &rhs) const
void Update(const std::list< boost::uuids::uuid > &x)
void Update(const std::pair< int, std::pair< std::string, std::string >> &x)
void Update(const std::map< std::string, std::vector< double >> &x)
Digest digest()
void Update(const std::map< int, std::string > &x)
DbTypes
This is the master list of all supported database types.
Definition: query_backend.h:31
void Update(const std::map< int, cyclus::Blob > &x)
void Update(const std::map< std::string, std::map< int, double >> &x)
void Update(const std::map< std::string, std::map< std::string, double >> &x)
#define CYCLUS_SHA1_NINT
Definition: query_backend.h:22
void Update(const std::set< cyclus::Blob > &x)
T GetVal(std::string field, int row=0)
Convenience method for retrieving a value from a specific row and named field (column).
void Update(const std::pair< std::pair< double, double >, std::map< std::string, double >> &x)
void Update(const std::map< std::string, cyclus::Blob > &x)
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.
void Update(const std::map< std::pair< std::string, std::string >, int > &x)
void Update(const std::map< std::string, std::pair< std::string, std::vector< double >>> &x)
void Update(const std::pair< double, std::map< int, double >> &x)
virtual QueryResult Query(std::string table, std::vector< Cond > *conds)
Return a set of rows from the specificed table that match all given conditions.
void Update(const std::map< int, boost::uuids::uuid > &x)
void Update(const std::set< std::string > &x)
bool operator==(const cyclus::Digest &rhs) const
void Update(const std::map< std::string, boost::uuids::uuid > &x)
void Update(const std::set< int > &x)
The digest type for SHA1s.
void Update(const std::list< int > &x)
std::vector< boost::spirit::hold_any > QueryRow
std::vector< std::string > fields
names of each field returned by a query
CmpOpCode opcode
The CmpOpCode cooresponding to op.
Cond(std::string field, std::string op, boost::spirit::hold_any val)
void Update(const std::pair< double, double > &x)
void Update(const std::vector< cyclus::Blob > &x)
Wrapper class for QueryableBackends that injects a set of Cond&#39;s into every query before being execut...
virtual std::set< std::string > Tables()
Return a set of all table names currently in the database.
void Update(const std::list< float > &x)
const std::string & str() const
Definition: blob.h:15
virtual std::list< ColumnInfo > Schema(std::string table)
Return information about all columns of a table.
std::vector< DbTypes > types
types of each field returned by a query.
An abstract base class for listeners (e.g.
Definition: rec_backend.h:16
void Update(const std::vector< double > &x)
std::string field
table column name
Wrapper class for QueryableBackends that injects prefix in front of the title/table for every query b...
bool operator!=(const cyclus::Digest &rhs) const
bool operator==(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint equality operator.
std::ostream & operator<<(std::ostream &out) const
virtual std::list< ColumnInfo > Schema(std::string table)
Return information about all columns of a table.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
void Update(const std::map< int, float > &x)
PrefixInjector(QueryableBackend *b, std::string prefix)
A type to represent variable-length array of bytes for dumping to a cyclus output database...
Definition: blob.h:9
void Update(const std::set< float > &x)
bool CmpCond(T *x, Cond *cond)
Compares a condiontion for a single value.
void Update(const std::vector< int > &x)
std::vector< QueryRow > rows
ordered results of a query
Represents a condition used to filter rows returned by a query.
std::vector< T > cast() const
Casts the value of this digest to a vector of the templated type.
void Update(const std::set< bool > &x)
void Update(const std::map< std::string, std::vector< std::pair< int, std::pair< std::string, std::string >>>> &x)
T const & cast() const
Definition: any.hpp:309
void Update(const std::map< int, bool > &x)
void Update(const std::vector< float > &x)
CmpOpCode
Represents operation codes for condition checking.
std::vector< int > shape
void Update(const std::vector< boost::uuids::uuid > &x)
virtual std::set< std::string > Tables()
Return a set of all table names currently in the database.
void Update(const std::list< std::string > &x)
void Update(const std::set< boost::uuids::uuid > &x)
Interface implemented by backends that support rudimentary querying.
void Update(const std::vector< std::pair< std::pair< double, double >, std::map< std::string, double >>> &x)
void Update(const std::map< std::string, std::string > &x)
void Update(const std::set< double > &x)
void Update(const std::map< std::string, double > &x)
void Update(const std::map< int, std::map< std::string, double >> &x)
For failed retrieval/insertion of key-based data into/from data structures.
Definition: error.h:47
void Update(const std::vector< std::pair< int, std::pair< std::string, std::string >>> &x)
void Update(const std::list< cyclus::Blob > &x)
Represents column information.
void Update(const std::list< std::pair< int, int >> &x)
void Update(const std::map< std::string, std::map< std::string, int >> &x)
void Clear()
Clears the current hash value to its default state.
void Update(const std::string &s)
Updates the hash value in-place.
#define CYCLUS_UUID_SIZE
Definition: query_backend.h:20