MonomialFactory.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_factories_MonomialFactory_h_
#define polybori_factories_MonomialFactory_h_
// include basic definitions
#include <polybori/pbori_defs.h>
#include <polybori/factories/CFactoryBase.h>
#include <polybori/BooleMonomial.h>
BEGIN_NAMESPACE_PBORI
class MonomialFactory:
public CFactoryBase {
typedef MonomialFactory self;
typedef CFactoryBase base;
public:
typedef base::parent_type parent_type;
typedef BooleMonomial value_type;
MonomialFactory(const parent_type& ring): base(ring) {}
MonomialFactory(const self& rhs): base(rhs) {}
~MonomialFactory() {}
value_type operator()() const {
return value_type(parent());
}
value_type operator()(const value_type::ring_type& ring) const {
return value_type(ring);
}
value_type operator()(const value_type& rhs) const {
return rhs;
}
value_type operator()(value_type::var_type var) const {
return value_type(var);
}
value_type operator()(const value_type::exp_type& rhs) const {
return value_type(rhs, parent());
}
value_type operator()(const value_type::exp_type& rhs,
const value_type::ring_type& ring) const {
return value_type(rhs, ring);
}
};
END_NAMESPACE_PBORI
#endif /* polybori_factories_MonomialFactory_h_ */