PairManagerFacade.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_PairManagerFacade_h_
#define polybori_groebner_PairManagerFacade_h_
#include "PairStatusSet.h"
// include basic definitions
#include "groebner_defs.h"
#include "PairManager.h"
BEGIN_NAMESPACE_PBORIGB
template <class StrategyType>
class PairManagerWithStrategy:
public PairManager {
public:
PairManagerWithStrategy(const PairManager& mgr, StrategyType& strategy):
PairManager(mgr), m_strategy(strategy) { }
using PairManager::cleanTopByChainCriterion;
void cleanTopByChainCriterion() { cleanTopByChainCriterion(m_strategy); }
void introducePair(const Pair& pair) { introducePair(pair, isHFE()); };
using PairManager::introducePair;
protected:
bool isHFE() const { return m_strategy.optHFE; }
private:
StrategyType& m_strategy;
};
template <class StrategyType>
class PairManagerFacade {
typedef PairManagerFacade self;
typedef StrategyType strategy_type;
public:
PairManagerFacade(const BoolePolyRing& ring):
pairs(ring, get()) {}
PairManagerFacade(const self& rhs):
pairs(rhs.pairs, get()) { }
void cleanTopByChainCriterion() { pairs.cleanTopByChainCriterion(get()); }
void introducePair(const Pair& pair) { pairs.introducePairs(pair, isHFE()); }
PairManagerWithStrategy<strategy_type> pairs;
private:
bool isHFE() const { return get().optHFE; }
strategy_type& get() { return static_cast<strategy_type&>(*this); }
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_PairManagerFacade_h_ */