这个类只是个基类,并没有实现什么,主要作用是给子类提供统一的接口
/** * \defgroup TaskBranchMerit Generic merit for branchers based on view and value selection * * \ingroup TaskBranchViewVal */ //@{ /** * \brief Base-class for merit class */ template<class _View, class _Val> class MeritBase { public: /// View type typedef _View View; /// Type of merit typedef _Val Val; /// Constructor for initialization MeritBase(Space& home, const VarBranch& vb); /// Constructor for cloning MeritBase(Space& home, bool share, MeritBase& mb); /// Whether dispose must always be called (that is, notice is needed) bool notice(void) const; /// Delete view merit class void dispose(Space& home); };
// Merit base class template<class View, class Val> forceinline MeritBase<View,Val>::MeritBase(Space&, const VarBranch&) {} template<class View, class Val> forceinline MeritBase<View,Val>::MeritBase(Space&, bool, MeritBase&) {} template<class View, class Val> forceinline bool MeritBase<View,Val>::notice(void) const { return false; } template<class View, class Val> forceinline void MeritBase<View,Val>::dispose(Space&) {}
时间: 2024-10-06 05:25:37