Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[genreflex] Add support for noStreamer and noInputOperator xml attribute
  • Loading branch information
LukasBreitwieser committed Aug 29, 2017
commit a7cbe8fe8c3e40c71915344a51ac7c828d1d3ce7
34 changes: 19 additions & 15 deletions core/dictgen/src/XMLReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -925,24 +925,28 @@ bool XMLReader::Parse(const std::string &fileName, SelectionRules& out)
iAttrName=attrs[i].fName;
iAttrValue=attrs[i].fValue;

if (tagKind == kClass && csr && "modifier" == iAttrName){
switch (iAttrValue.at(0)) {
case '+':
csr->SetRequestStreamerInfo(true);
break;
case '!':
csr->SetRequestNoInputOperator(true);
break;
case '-':
csr->SetRequestNoStreamer(true);
break;
default:
// request no streamer
if (tagKind == kClass && csr && "noStreamer" == iAttrName){
if (iAttrValue == "true") {
csr->SetRequestNoStreamer(true);
} else if (iAttrValue != "false") {
ROOT::TMetaUtils::Error(0,
"XML at line %s: class attribute modifier must be one of +/-/! (it was %s)\n",
"XML at line %s: class attribute 'noStreamer' must be 'true' or 'false' (it was %s)\n",
lineNumCharp, iAttrValue.c_str());
}
continue;
}
}

// request no input operator
if (tagKind == kClass && csr && "noInputOperator" == iAttrName){
if (iAttrValue == "true") {
csr->SetRequestNoInputOperator(true);
} else if (iAttrValue != "false") {
ROOT::TMetaUtils::Error(0,
"XML at line %s: class attribute 'noInputOperator' must be 'true' or 'false' (it was %s)\n",
lineNumCharp, iAttrValue.c_str());
}
}

// Set the class version
if (tagKind == kClass &&
csr &&
Expand Down
9 changes: 6 additions & 3 deletions core/dictgen/src/rootcling_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5467,14 +5467,17 @@ int GenReflexMain(int argc, char **argv)
" applied will not be persistified if requested.\n"
" - comment [string]: what you could write in code after an inline comment\n"
" without \"//\". For example comment=\"!\" or \"||\".\n"
" - modifier [string]: Has the meaning of the trailing modifier in a LinkDef\n"
" file."
" - noStreamer [true/false]: turns off streamer generation if set to 'true.'\n"
" Default value is 'false'\n"
" - noInputOperator [true/false]: turns off input operator generation if set\n"
" to 'true'. Default value is 'false'\n"
" Example XML:\n"
" <lcgdict>\n"
" [<selection>]\n"
" <class [name=\"classname\"] [pattern=\"wildname\"]\n"
" [file_name=\"filename\"] [file_pattern=\"wildname\"]\n"
" [id=\"xxxx\"] [modifier=\"+/-/!\"]/>\n"
" [id=\"xxxx\"] [noStreamer=\"true/false\"]\n"
" [noInputOperator=\"true/false\"] />\n"
" <class name=\"classname\" >\n"
" <field name=\"m_transient\" transient=\"true\"/>\n"
" <field name=\"m_anothertransient\" persistent=\"false\"/>\n"
Expand Down