Skip to content
Snippets Groups Projects
Commit 85bcef1d authored by Martin Killenberg's avatar Martin Killenberg
Browse files

added direct import to xml mapper

parent 614d7c27
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,8 @@ namespace ChimeraTK{
VariableMapper(VariableMapper &)=delete;
void operator=(VariableMapper const &)=delete;
void directImport(std::set< std::string > inputVariables);
protected:
VariableMapper()=default;
......
......@@ -167,6 +167,14 @@ namespace ChimeraTK{
return output;
}
void VariableMapper::directImport(std::set< std::string > inputVariables){
_inputVariables=inputVariables;
_locationDefaults.clear();
_globalDefaults = PropertyAttributes();
_inputSortedDescriptions.clear();
import("/",""); // import from /, create location names from first level of the tree
}
} // namespace ChimeraTK
......@@ -109,6 +109,11 @@ BOOST_AUTO_TEST_CASE( testImportAll ){
});
testXmlParsing("variableTreeXml/importAll.xml", propertyMap);
// test direct mapping without xml
VariableMapper & vm = VariableMapper::getInstance();
vm.directImport( generateInputVariables());
BOOST_CHECK( mapCompare( vm.getAllProperties(), propertyMap) );
// modify the expected property map for the renaming case
propertyMap["/DIRECT/DOUBLE"]= VariableMapper::PropertyDescription("DIRECT","BAR");
propertyMap["/DIRECT/INT"]= VariableMapper::PropertyDescription("DIRECT","FOO");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment