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