当前位置: 首页>>代码示例>>C++>>正文


C++ TextParser::chkNode方法代码示例

本文整理汇总了C++中TextParser::chkNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TextParser::chkNode方法的具体用法?C++ TextParser::chkNode怎么用?C++ TextParser::chkNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextParser的用法示例。


在下文中一共展示了TextParser::chkNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadDfiFile


//.........这里部分代码省略.........
  }
  else {
    P0 = ct2;
  }
  
  //DiffPrs
  label = "/Unit/DiffPrs";
  if ( !(tpCntl.getInspectedValue(label, ct2 )) )
  {
    Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
    Exit(0);
  }
  else {
    DiffPrs = ct2;
  }
  
  
  //FilePath
  label = "/FilePath/Process";
  if ( !(tpCntl.getInspectedValue(label, str )) )
  {
    Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
    Exit(0);
  }
  dfi_proc=str;
  
  //read process
  ReadDfiProc(dfi_proc);
  
  
  //TimeSlice
  nnode=0;
  label_base = "/TimeSlice/Slice";
  if ( tpCntl.chkNode(label_base) )  //nodeがあれば
  {
    nnode = tpCntl.countLabels(label_base);
  }
  
  label_base = "/TimeSlice";
  for (int i=0; i<nnode; i++)
  {
    if ( !(tpCntl.getNodeStr(label_base, i+1, str)) )
    {
      printf("\tParsing error : No Elem name\n");
      Exit(0);
    }
    
    if( strcasecmp(str.substr(0,5).c_str(), "Slice") ) continue;
    
    //step
    label=label_base+"/"+str+"/Step";
    if ( !(tpCntl.getInspectedValue(label, ct )) )
    {
      Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
      Exit(0);
    }
    
    //time
    label=label_base+"/"+str+"/Time";
    if ( !(tpCntl.getInspectedValue(label, ct2 )) )
    {
      Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
      Exit(0);
    }
    
    SetSlice(ct,ct2);
开发者ID:VisCore618,项目名称:FFVC,代码行数:67,代码来源:dfiinfo.C

示例2: ReadDfiProc


//.........这里部分代码省略.........
    Exit(0);
  }
  else {
    NumberOfGroup = ct;
  }
  
  
  ////RankID_in_MPIworld
  //label = "/DistributedFileInfo/RankIDinMPIworld";
  //if ( !(tpCntl.getInspectedValue(label, &ct )) ) {
  //  Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
  //  Exit(0);
  //}
  //else {
  //  RankID_in_MPIworld = ct;
  //}
  
  ////GroupID_in_MPIworld
  //label = "/DistributedFileInfo/GroupIDinMPIworld";
  //if ( !(tpCntl.getInspectedValue(label, &ct )) ) {
  //  Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
  //  Exit(0);
  //}
  //else {
  //  GroupID_in_MPIworld = ct;
  //}
  
  
  //Process <--- NodeInfo
  
  nnode=0;
  //label_base = "/DistributedFileInfo/NodeInfo";
  label_base = "/Process";
  if ( tpCntl.chkNode(label_base) )  //nodeがあれば
  {
    nnode = tpCntl.countLabels(label_base);
  }
  NodeInfoSize=nnode;
  Node = new DfiInfo::NodeInfo[nnode];
  
  for (int i=0; i<NodeInfoSize; i++)
  {
    if ( !(tpCntl.getNodeStr(label_base, i+1, str)) )
    {
      printf("\tParsing error : No Elem name\n");
      Exit(0);
    }
    if( strcasecmp(str.substr(0,4).c_str(), "Rank") ) continue;
    label_leaf=label_base+"/"+str;
    
    //RankID
    label = label_leaf + "/ID";
    if ( !(tpCntl.getInspectedValue(label, ct )) )
    {
      Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
      Exit(0);
    }
    else {
      Node[i].RankID= ct;
    }
    
    //HostName
    label = label_leaf + "/HostName";
    if ( !(tpCntl.getInspectedValue(label, str )) )
    {
      Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n", label.c_str());
开发者ID:VisCore618,项目名称:FFVC,代码行数:67,代码来源:dfiinfo.C


注:本文中的TextParser::chkNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。