29 cyclus::Institution::InitFrom(m);
30 int rawcycpp_shape_latitude[1] = {-1};
31 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
32 int rawcycpp_shape_longitude[1] = {-1};
33 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
34 int rawcycpp_shape_prototypes[2] = {-1, -1};
36 latitude = m->latitude;
37 longitude = m->longitude;
42 virtual void InitFrom(cyclus::QueryableBackend* b) {
43 cyclus::Institution::InitFrom(b);
44 int rawcycpp_shape_latitude[1] = {-1};
45 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
46 int rawcycpp_shape_longitude[1] = {-1};
47 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
48 int rawcycpp_shape_prototypes[2] = {-1, -1};
50 cyclus::QueryResult qr = b->Query(
"Info", NULL);
51 latitude = qr.GetVal<
double>(
"latitude");
52 longitude = qr.GetVal<
double>(
"longitude");
53 prototypes = qr.GetVal<std::vector< std::string > >(
"prototypes");
57 virtual void InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
58 cyclus::Institution::InfileToDb(tree, di);
59 int rawcycpp_shape_latitude[1] = {-1};
60 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
61 int rawcycpp_shape_longitude[1] = {-1};
62 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
63 int rawcycpp_shape_prototypes[2] = {-1, -1};
65 cyclus::InfileTree* sub = tree->SubTree(
"config/*");
68 if (sub->NMatches(
"latitude") > 0) {
70 double latitude_val = cyclus::Query<double>(sub,
"latitude");
71 latitude = latitude_val;
74 double latitude_tmp = 0.0;
75 latitude = latitude_tmp;
77 if (sub->NMatches(
"longitude") > 0) {
79 double longitude_val = cyclus::Query<double>(sub,
"longitude");
80 longitude = longitude_val;
83 double longitude_tmp = 0.0;
84 longitude = longitude_tmp;
87 cyclus::InfileTree* bub = sub->SubTree(
"prototypes", 0);
88 cyclus::InfileTree* sub = bub;
89 int n1 = sub->NMatches(
"val");
90 std::vector< std::string > prototypes_val;
91 prototypes_val.resize(n1);
92 for (
int i1 = 0; i1 < n1; ++i1) {
95 std::string elem_in = cyclus::Query<std::string>(sub,
"val", i1);
98 prototypes_val[i1] = elem;
103 ->AddVal(
"latitude", latitude, &cycpp_shape_latitude)
104 ->AddVal(
"longitude", longitude, &cycpp_shape_longitude)