本文整理汇总了C++中Configurator::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ Configurator::Init方法的具体用法?C++ Configurator::Init怎么用?C++ Configurator::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurator
的用法示例。
在下文中一共展示了Configurator::Init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char**argv)
{
Board * CAEN_V1742_instance = new CAEN_V1742 () ;
Configurator * config = new Configurator () ;
config->xmlFileName = argv[1] ;
config->Init () ; // load configurator
// find the board in the cfg
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
xmlNode * hw_node = NULL;
for (hw_node = config->root_element->children ; hw_node ; hw_node = hw_node->next)
{
if (hw_node->type == XML_ELEMENT_NODE &&
xmlStrEqual (hw_node->name, xmlCharStrdup ("Hardware")) )
break;
}
xmlNode * board_node = NULL;
for ( board_node = hw_node->children ; board_node ; board_node = board_node->next)
{
if (board_node->type == XML_ELEMENT_NODE
&& xmlStrEqual (board_node->name, xmlCharStrdup ("board")) )
{
int ID = Configurator::GetInt (Configurable::getElementContent (*config, "ID" , board_node)) ;
cout << "[2] Configuring Board ID = "
<< ID
<< " type= "
<< Configurable::getElementContent (*config, "type" , board_node)
<< endl ;
if (Configurable::getElementContent (*config, "type", board_node) == "CAEN_V1742") break ;
}
}
BoardConfig bC ;
bC.Init (*config) ;
bC.SetBoardNode (board_node) ;
CAEN_V1742_instance->Config (&bC) ;
CAEN_V1742_instance->Print () ;
delete CAEN_V1742_instance ;
return 0 ;
}