PolyBoRi
TermsFacade.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_TermsFacade_h_
00017 #define polybori_groebner_TermsFacade_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 
00022 BEGIN_NAMESPACE_PBORIGB
00023 
00029 template <class NewType>
00030 class TermsFacade:
00031   public MonomialSet {
00032 
00033   typedef MonomialSet base;
00034 
00035 public:
00037   template <class Type>
00038   TermsFacade(const Type& value): base(value) { }
00039 
00041   void update(const PolyEntry& entry) { 
00042     if (get().isCompatible(entry))
00043       operator=(unite(entry.lead.set()));
00044   }
00045   
00046 private:
00047   TermsFacade& operator=(const TermsFacade& rhs) {
00048     return static_cast<TermsFacade&>(static_cast<base&>(*this) = rhs);
00049   }
00050 
00052   const NewType& get() const { return static_cast<const NewType&>(*this); }
00053 };
00054 
00055 END_NAMESPACE_PBORIGB
00056 
00057 #endif /* polybori_groebner_TermsFacade_h_ */