码迷,mamicode.com
首页 > 其他好文 > 详细

gecode中的meritbase

时间:2017-09-02 14:31:43      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:view   delete   code   initial   void   force   cpp   notice   var   

这个类只是个基类,并没有实现什么,主要作用是给子类提供统一的接口

  /**
   * \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&) {}

  

gecode中的meritbase

标签:view   delete   code   initial   void   force   cpp   notice   var   

原文地址:http://www.cnblogs.com/crax/p/7466339.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!