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


C++ SpeciesReference::getAncestorOfType方法代码示例

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


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

示例1: SBMLDocument

END_TEST


START_TEST ( test_Reaction_parent_NULL )
{
    SBMLDocument *d = new SBMLDocument();
    Model *m = d->createModel();
    Reaction *c = m->createReaction();
    SpeciesReference *sr = c->createReactant();
    KineticLaw *kl = c->createKineticLaw();

    fail_unless(c->getAncestorOfType(SBML_MODEL) == m);
    fail_unless (c->getSBMLDocument() == d);
    fail_unless(sr->getAncestorOfType(SBML_REACTION) == c);
    fail_unless(kl->getAncestorOfType(SBML_REACTION) == c);

    Reaction *c1 = c->clone();
    delete d;

    fail_unless(c1->getAncestorOfType(SBML_MODEL) == NULL);
    fail_unless(c1->getParentSBMLObject() == NULL);
    fail_unless (c1->getSBMLDocument() == NULL);

    SpeciesReference *sr1 = c1->getReactant(0);
    fail_unless(sr1->getAncestorOfType(SBML_MODEL) == NULL);
    fail_unless(sr1->getAncestorOfType(SBML_REACTION) == c1);
    fail_unless (sr1->getSBMLDocument() == NULL);

    fail_unless(c1->getKineticLaw()->getAncestorOfType(SBML_MODEL) == NULL);
    fail_unless(c1->getKineticLaw()->getAncestorOfType(SBML_REACTION) == c1);
    fail_unless (c1->getKineticLaw()->getSBMLDocument() == NULL);


    delete c1;
}
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:35,代码来源:TestSBMLParentObject.cpp


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