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


C++ IAlgorithm_sptr::name方法代码示例

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


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

示例1: startingHandle

/** Handler of the start notifications. Adds an algorithm call to the script.
 * @param alg :: Shared pointer to the starting algorithm.
 */
void RecordPythonScript::startingHandle(API::IAlgorithm_sptr alg)
{
  auto props= alg->getProperties();

  std::string algString;
  for(auto p = props.begin() ; p != props.end(); ++p)
  {
    std::string opener = "='"; 
    if ((**p).value().find('\\') != std::string::npos )
    {
      opener= "=r'";
    }

    std::string paramString = (**p).name() + opener + (**p).value() + "'";

    // Miss out parameters that are empty.
    if(paramString.length() != 0)
    {
      if(algString.length() != 0)
      {
        algString += ",";
      }
      algString += paramString;
    }
  }

  m_generatedScript +=  alg->name() + "(" + algString + ")\n";
}
开发者ID:BigShows,项目名称:mantid,代码行数:31,代码来源:RecordPythonScript.cpp

示例2: findFilenameProperty

void Load::findFilenameProperty(const API::IAlgorithm_sptr &loader) {
  // Use the first file property as the main Filename
  const auto &props = loader->getProperties();
  for (auto prop : props) {
    auto *fp = dynamic_cast<API::MultipleFileProperty *>(prop);
    auto *fp2 = dynamic_cast<API::FileProperty *>(prop);
    if (fp) {
      m_filenamePropName = fp->name();
      break;
    }
    if (fp2) {
      m_filenamePropName = fp2->name();
      break;
    }
  }
  if (m_filenamePropName.empty()) {
    setPropertyValue("LoaderName", "");
    setProperty("LoaderVersion", -1);
    throw std::runtime_error("Cannot find FileProperty on " + loader->name() +
                             " algorithm.");
  }
}
开发者ID:mantidproject,项目名称:mantid,代码行数:22,代码来源:Load.cpp


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