本文整理汇总了C++中MethodTable::insertInheritedMethods方法的典型用法代码示例。如果您正苦于以下问题:C++ MethodTable::insertInheritedMethods方法的具体用法?C++ MethodTable::insertInheritedMethods怎么用?C++ MethodTable::insertInheritedMethods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MethodTable
的用法示例。
在下文中一共展示了MethodTable::insertInheritedMethods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeMethods
/** Make member methods for this class */
RevLanguage::MethodTable TimeTree::makeMethods( void ) const
{
MethodTable methods = MethodTable();
ArgumentRules* nnodesArgRules = new ArgumentRules();
methods.addFunction("nnodes", new MemberProcedure(Natural::getClassTypeSpec(), nnodesArgRules ) );
ArgumentRules* ntipsArgRules = new ArgumentRules();
methods.addFunction("ntips", new MemberProcedure(Natural::getClassTypeSpec(), ntipsArgRules ) );
ArgumentRules* heightArgRules = new ArgumentRules();
methods.addFunction("rootAge", new MemberProcedure(RealPos::getClassTypeSpec(), heightArgRules ) );
ArgumentRules* namesArgRules = new ArgumentRules();
methods.addFunction("names", new MemberProcedure(ModelVector<RlString>::getClassTypeSpec(), namesArgRules ) );
ArgumentRules* rescaleArgRules = new ArgumentRules();
rescaleArgRules->push_back( new ArgumentRule( "factor", RealPos::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
methods.addFunction("rescale", new MemberProcedure(RlUtils::Void, rescaleArgRules ) );
// Insert inherited methods
methods.insertInheritedMethods( ModelObject<RevBayesCore::TimeTree>::makeMethods() );
return methods;
}
示例2: makeMethods
MethodTable RlAtlas::makeMethods( void ) const
{
MethodTable methods;
ArgumentRules* nAreasArgRules = new ArgumentRules();
ArgumentRules* nEpochsArgRules = new ArgumentRules();
ArgumentRules* namesArgRules = new ArgumentRules();
methods.addFunction("names", new MemberProcedure(ModelVector<RlString>::getClassTypeSpec(), namesArgRules ) );
methods.addFunction("nAreas", new MemberProcedure(Natural::getClassTypeSpec(), nAreasArgRules ) );
methods.addFunction("nEpochs", new MemberProcedure(Natural::getClassTypeSpec(), nEpochsArgRules ) );
// Add method for call "size" as a function
ArgumentRules* sizeArgRules = new ArgumentRules();
methods.addFunction("size", new MemberProcedure( Natural::getClassTypeSpec(), sizeArgRules) );
// Insert inherited methods
methods.insertInheritedMethods( ModelObject<RevBayesCore::TimeAtlas>::makeMethods() );
return methods;
}