本文整理汇总了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";
}
示例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.");
}
}