You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to add a new supported type in Cyclus, needs to be done:
add you type in the DbTypes enum list in src/query_backend.h
each variation length type (used in you custom type) need to be both as TYPE and VL_TYPE
each line need a comment formatted as follow: // {"c++ type (with namespacing etc...)", NB_OF_VL_TYPE, ["HDF5","SQLite"],["CYCLUS TYPE DEFINITION"],true/false]
the "CYCLUS TYPE DEFINITION" should be:
for std::map<X,Y> : ["MAP", "X", "Y"] or ["VL_MAP","X","Y"]
for a std::vector<Z>: ["VECTOR","Z"] or ["VL_VECTOR","Z"]
...
I am not sure what the true or false rule is...
HDF5 and/or Sqlite should appear depending on needs (at least one is required)
add the inline void Update( method at the end of the src/query_backend.h file in the Sha1 class
for SQLite type support (i.e. if you added "SQLite" in the comment) edit src/sqlite_back.cc in 3 locations:
add you method in #define CYCLUS_BINDVAL(D, T):
add a method mapping your new type with Cyclus naming:
replace , by CYCLUS_COMMA when describing the cpp type
cyclus naming is all capital underscore separation:
- std::map<std::string, std::vector>->MAP_STRING_VECTOR_DOUBLE`
the same way add you method in #define CYCLUS_LOADVAL(D, T)
to add a new supported type in Cyclus, needs to be done:
add you type in the
DbTypes
enum list in src/query_backend.hTYPE
andVL_TYPE
// {"c++ type (with namespacing etc...)", NB_OF_VL_TYPE, ["HDF5","SQLite"],["CYCLUS TYPE DEFINITION"],true/false]
std::map<X,Y>
:["MAP", "X", "Y"]
or["VL_MAP","X","Y"]
std::vector<Z>
:["VECTOR","Z"]
or["VL_VECTOR","Z"]
true
orfalse
rule is...add the
inline void Update(
method at the end of thesrc/query_backend.h
file in theSha1
classfor SQLite type support (i.e. if you added "SQLite" in the comment) edit
src/sqlite_back.cc
in 3 locations:add you method in
#define CYCLUS_BINDVAL(D, T)
:,
byCYCLUS_COMMA
when describing the cpp type- std::map<std::string, std::vector>
->
MAP_STRING_VECTOR_DOUBLE`the same way add you method in
#define CYCLUS_LOADVAL(D, T)
add you type in
DbTypes SqliteBack::Type(
:type_map[&typeid(FULL_CPP_TYPE_WITH_NAMESPACE)] = CYCLUS_NAME_TYPE
- std::map<std::string, std::vector>
->
MAP_STRING_VECTOR_DOUBLE`for HDF5 it should be done automaticity (hopefully), a
git clean -fx
might be required (clear all file not followed by git)with that you should be good to go !
The text was updated successfully, but these errors were encountered: