PolyBoRi
PairManagerFacade.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
15 //*****************************************************************************
16 
17 #ifndef polybori_groebner_PairManagerFacade_h_
18 #define polybori_groebner_PairManagerFacade_h_
19 
20 #include "PairStatusSet.h"
21 
22 
23 // include basic definitions
24 #include "groebner_defs.h"
25 #include "PairManager.h"
26 
28 
40 template <class StrategyType>
42  public PairManager {
43 
44 public:
45  PairManagerWithStrategy(const PairManager& mgr, StrategyType& strategy):
46  PairManager(mgr), m_strategy(strategy) { }
47 
49  using PairManager::cleanTopByChainCriterion;
50 
53 
55  void introducePair(const Pair& pair) { introducePair(pair, isHFE()); };
56 
58  using PairManager::introducePair;
59 
60 protected:
61  bool isHFE() const { return m_strategy.optHFE; }
62 
63 private:
64  StrategyType& m_strategy;
65 };
66 
78 template <class StrategyType>
80  typedef PairManagerFacade self;
81  typedef StrategyType strategy_type;
82 
83 public:
84 
86  pairs(ring, get()) {}
87 
88  PairManagerFacade(const self& rhs):
89  pairs(rhs.pairs, get()) { }
90 
91  void cleanTopByChainCriterion() { pairs.cleanTopByChainCriterion(get()); }
92  void introducePair(const Pair& pair) { pairs.introducePairs(pair, isHFE()); }
93 
96 
97 private:
98  bool isHFE() const { return get().optHFE; }
99  strategy_type& get() { return static_cast<strategy_type&>(*this); }
100 };
101 
103 
104 #endif /* polybori_groebner_PairManagerFacade_h_ */