Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit f746278b authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add getter and setter for a full row

parent 33370725
......@@ -23,6 +23,38 @@ std::string ph5_licenceSaveStr(){
return body;
}
///Save the header of the given PTable
/** @param table : PTable to be used
* @return corresponding string
*/
std::string ph5_backendTableHeaderRowSetterGetter(const PTable & table){
std::string body("");
body += "\t\tvoid setRow(size_t i";
const PVecAttribute & vecAttriute = table.getVecAttribute();
for(PVecAttribute::const_iterator it(vecAttriute.begin()); it != vecAttriute.end(); ++it){
std::string type(it->getType());
body += ", " + type + " ";
if(ph5_attributeIsTensor(*it)){
body += "* ";
}
body += it->getName();
}
body += ");\n";
body += "\t\tvoid getRow(size_t i";
for(PVecAttribute::const_iterator it(vecAttriute.begin()); it != vecAttriute.end(); ++it){
std::string type(it->getType());
body += ", " + type + " ";
if(ph5_attributeIsTensor(*it)){
body += "*&";
}else{
body += "&";
}
body += " " + it->getName();
}
body += ");\n";
return body;
}
///Save the header of the given PTable
/** @param table : PTable to be used
* @return corresponding string
......@@ -157,6 +189,8 @@ std::string ph5_backendTableHeader(const PTable & table){
body += "\t\tvoid write(H5::H5File & file) const;\n";
body += "\t\tvoid write(H5::Group & group) const;\n\n";
body += ph5_backendTableHeaderRowSetterGetter(table);
body += ph5_backendTableHeaderSetter(table);
body += ph5_backendTableHeaderGetter(table);
body += "\n";
......@@ -312,6 +346,46 @@ std::string ph5_backendTableSourceWrite(const PTable & table){
return body;
}
///Save the header of the given PTable
/** @param table : PTable to be used
* @return corresponding string
*/
std::string ph5_backendTableSourceRowSetterGetter(const PTable & table){
std::string body(""), name(table.getName());
body += "void "+name+"::setRow(size_t i";
const PVecAttribute & vecAttriute = table.getVecAttribute();
for(PVecAttribute::const_iterator it(vecAttriute.begin()); it != vecAttriute.end(); ++it){
std::string type(it->getType());
body += ", " + type + " ";
if(ph5_attributeIsTensor(*it)){
body += "* ";
}
body += it->getName();
}
body += "){\n";
for(PVecAttribute::const_iterator it(vecAttriute.begin()); it != vecAttriute.end(); ++it){
body += "\tset" + firstToUpper(it->getName()) + "(i, "+it->getName()+");\n";
}
body += "}\n\n";
body += "\t\tvoid "+name+"::getRow(size_t i";
for(PVecAttribute::const_iterator it(vecAttriute.begin()); it != vecAttriute.end(); ++it){
std::string type(it->getType());
body += ", " + type + " ";
if(ph5_attributeIsTensor(*it)){
body += "*&";
}else{
body += "&";
}
body += " " + it->getName();
}
body += "){\n";
for(PVecAttribute::const_iterator it(vecAttriute.begin()); it != vecAttriute.end(); ++it){
body += "\t"+it->getName()+" = get" + firstToUpper(it->getName()) + "(i);\n";
}
body += "}\n\n";
return body;
}
///Save the header of the given PTable
/** @param table : PTable to be used
* @return corresponding string
......@@ -701,6 +775,7 @@ std::string ph5_backendTableSource(const PTable & table){
body += ph5_backendTableSourceRead(table);
body += ph5_backendTableSourceWrite(table);
body += ph5_backendTableSourceRowSetterGetter(table);
body += ph5_backendTableSourceSetter(table);
body += ph5_backendTableSourceGetter(table);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment