00001 // -*- c++ -*- 00002 //***************************************************************************** 00015 //***************************************************************************** 00016 00017 #ifndef polybori_factories_MonomialFactory_h_ 00018 #define polybori_factories_MonomialFactory_h_ 00019 00020 // include basic definitions 00021 #include <polybori/pbori_defs.h> 00022 #include <polybori/factories/CFactoryBase.h> 00023 #include <polybori/BooleMonomial.h> 00024 00025 BEGIN_NAMESPACE_PBORI 00026 00033 class MonomialFactory: 00034 public CFactoryBase { 00036 typedef MonomialFactory self; 00037 00039 typedef CFactoryBase base; 00040 00041 public: 00043 typedef base::parent_type parent_type; 00044 00046 typedef BooleMonomial value_type; 00047 00049 MonomialFactory(const parent_type& ring): base(ring) {} 00050 00052 MonomialFactory(const self& rhs): base(rhs) {} 00053 00055 ~MonomialFactory() {} 00056 00058 value_type operator()() const { 00059 return value_type(parent()); 00060 } 00061 00063 value_type operator()(const value_type::ring_type& ring) const { 00064 return value_type(ring); 00065 } 00066 00068 value_type operator()(const value_type& rhs) const { 00069 return rhs; 00070 } 00071 00073 value_type operator()(value_type::var_type var) const { 00074 return value_type(var); 00075 } 00076 00078 value_type operator()(const value_type::exp_type& rhs) const { 00079 return value_type(rhs, parent()); 00080 } 00081 00083 value_type operator()(const value_type::exp_type& rhs, 00084 const value_type::ring_type& ring) const { 00085 return value_type(rhs, ring); 00086 } 00087 00088 }; 00089 00090 END_NAMESPACE_PBORI 00091 00092 #endif /* polybori_factories_MonomialFactory_h_ */