本文整理汇总了C++中Constant::GetTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ Constant::GetTitle方法的具体用法?C++ Constant::GetTitle怎么用?C++ Constant::GetTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constant
的用法示例。
在下文中一共展示了Constant::GetTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: multiply_constants
/**
* Factory: DD4hep_XML-In-Memory
*
* Though there is a file name given, it is read FIRST and then parsed.
* Similar to a in memory XML string.
*
* \author M.Frank
* \version 1.0
* \date 20/01/2018
*/
static int multiply_constants (Detector& detector, int argc, char** argv) {
bool help = false;
for(int i=0; i<argc && argv[i]; ++i) {
if ( 0 == ::strncmp("-help",argv[i],4) )
help = true;
else
help = true;
}
if ( help ) {
/// Help printout describing the basic command line interface
cout <<
"Usage: -plugin <name> -arg [-arg] \n"
" name: factory name DD4hep_TestConstantsMultiplier \n"
"\tArguments given: " << arguments(argc,argv) << endl << flush;
::exit(EINVAL);
}
int num_test = 0;
const auto& constants = detector.constants();
for(const auto e : constants) {
Constant c = e.second;
if ( c.dataType() == "number" ) {
try {
double res = _multiply(c.name(),1.0);
printout(INFO,"TestConstantsMultiplier","+++ Constant: %-16s = %-16s [%s] -> %-16s = %9.3g",
c.name(), c->GetTitle(), c.dataType().c_str(), c.name(), res);
++num_test;
}
catch(...) {
}
}
}
printout(ALWAYS,"TestConstantsMultiplier",
"+++ Tested %d numeric constants for expression evaluation.",num_test);
return 1;
}