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


C++ FunctionDefinition::getId方法代码示例

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


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

示例1: MMOFunction

void
MMOModel::add (const FunctionDefinition &f)
{
  string fname = f.getId ();
  MMOFunction *func = new MMOFunction (fname);
  int na = f.getNumArguments ();
  MMOMath d = MMOMath (_replace, &_functions, _prefix);
  list<string> funcArgs;
  for (int i = 0; i < na; i++)
    {
      d.parseEquation (f.getArgument (i));
      string argExp = d.getExp ();
      MMODecl *adec = new MMODecl (argExp, function_input);
      func->add (adec);
      funcArgs.push_back (argExp);
    }
  string var = MMOUtils::getInstance ()->getVar ();
  d.parseEquation (f.getBody ());
  _addAlgebraicReplacement (d);
  MMODecl *adec = new MMODecl (var, d.getExp (), function_definition);
  func->add (adec);
  _functions[fname] = pair<list<string>, ASTNode*> (
      funcArgs, new ASTNode (*f.getBody ()));
  _add (func, external_functions);
}
开发者ID:RexFuzzle,项目名称:qss-solver,代码行数:25,代码来源:mmo_model.cpp

示例2:

void 
FunctionDefinitionRecursion::addDependencies(const Model& m, 
                                         const FunctionDefinition& object)
{
  unsigned int ns;
  std::string thisId = object.getId();

  /* loop thru the list of names in the Math
    * if they refer to a FunctionDefinition add to the map
    * with the variable as key
    */
  List* variables = object.getMath()->getListOfNodes( ASTNode_isFunction );
  for (ns = 0; ns < variables->getSize(); ns++)
  {
    ASTNode* node = static_cast<ASTNode*>( variables->get(ns) );
    string   name = node->getName() ? node->getName() : "";

    if (m.getFunctionDefinition(name))
    {
      mIdMap.insert(pair<const std::string, std::string>(thisId, name));
    }
  }

  delete variables;
}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:25,代码来源:FunctionDefinitionRecursion.cpp

示例3: logFailure

/**
 * Logs a message about an undefined variable in the given
 * FunctionDefinition.
 */
void
FunctionDefinitionVars::logUndefined ( const FunctionDefinition& fd,
                                       const string& varname )
{
  msg =
  msg =
    //"Inside the 'lambda' of a <functionDefinition>, if a 'ci' element is not "
    //"the first element within a MathML 'apply', then the 'ci''s value can "
    //"only be the value of a 'bvar' element declared in that 'lambda'. In "
    //"other words, all model entities referenced inside a function definition "
    //"must be passed arguments to that function. (References: L2V2 Section "
    //"4.3.2.)" 
    "The variable '";

  msg += varname;
  msg += "' is not listed as a <bvar> of FunctionDefinition '";
  msg += fd.getId();
  msg += "'.";
  
  logFailure(fd);
}
开发者ID:Alcibiades586,项目名称:roadrunner,代码行数:25,代码来源:FunctionDefinitionVars.cpp

示例4:

void
CompIdBase::checkId (const FunctionDefinition& x)
{
  if (x.isSetId()) doCheckId(x.getId(), x);
}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:5,代码来源:CompIdBase.cpp


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