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


C++ ConfigReader::addComposed方法代码示例

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


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

示例1: initialize

   bool OperatorEnergyChannels::initialize(ConfigReader& cr,Simulation& sim,SimulationClasses& simClasses) {
      initialized = true;
      simClasses.logger << "(SEP OP ENERGY CHANNELS) Starting initialization" << endl << write;
      
      // Init base class:
      if (OperatorAccumulationBase::initialize(cr,sim,simClasses) == false) {
	 simClasses.logger << "(SEP OP ENERGY CHANNELS) ERROR: OperatorAccumulationBase failed to initialize!" << endl << write;
	 initialized = false;
      }

      // Create a profiler section name for this DataOperator:
      #if PROFILE_LEVEL > 0
         stringstream ss;
         ss << "Energy Channels" << OperatorAccumulationBase::getOrder();
         profileName = ss.str();
         OperatorAccumulationBase::setProfileName(ss.str());
      #endif
      
      // Get names of instruments:
      vector<string> instrumentNames;
      cr.addComposed(PREFIX+".instrument_names","Names of energy instruments (string).");
      cr.parse();
      cr.get(PREFIX+".instrument_names",instrumentNames);

      //instrumentIndices.push_back(make_pair<size_t,size_t>(0,0));
      for (size_t i=0; i<instrumentNames.size(); ++i) {
	 // Skip empty lines
	 if (instrumentNames[i].size() == 0) continue;

	 // Read config file items for instrument and create it:
	 if (createInstrument(simClasses,cr,instrumentNames[i]) == false) {
	    simClasses.logger << "(SEP OP ENERGY CHANNELS) ERROR: Failed to read required config file items for ";
	    simClasses.logger << "instrument '" << instrumentNames[i] << "'" << endl << write;
	    initialized = false;
	 }
      }

      // Write init status and exit:
      simClasses.logger << "(SEP OP ENERGY CHANNELS) Initialization complete, status is ";
      if (initialized == true) simClasses.logger << "SUCCESS" << endl << write;
      else simClasses.logger << "FAILURE" << endl << write;
      
      return initialized;
   }
开发者ID:fmihpc,项目名称:corsair,代码行数:44,代码来源:sep_operator_energy_channels.cpp

示例2: addConfigFileItems

 bool SpatialSliceOP::addConfigFileItems(ConfigReader& cr) {
    cr.addComposed(prefix+".sliced_coordinate","Sliced coordinate: x/y/z (string).");
    cr.addComposed(prefix+".slice_origin","Origin of 2D spatial mesh slice (float).");
    cr.addComposed(prefix+".slice_geometry","Geometry of output mesh cartesian/cylindrical (string)");
    return true;
 }
开发者ID:fmihpc,项目名称:corsair,代码行数:6,代码来源:sep_operator_spatial_slice.cpp


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