PolyBoRi
SetFactory.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00015 //*****************************************************************************
00016 
00017 #ifndef polybori_SetFactory_h_
00018 #define polybori_SetFactory_h_
00019 
00020 // include basic definitions
00021 #include <polybori/pbori_defs.h>
00022 #include <polybori/factories/CFactoryBase.h>
00023 #include <polybori/BooleSet.h>
00024 #include <polybori/BooleMonomial.h>
00025 BEGIN_NAMESPACE_PBORI
00026 
00033 class SetFactory:
00034   public CFactoryBase {
00036   typedef SetFactory self;
00037 
00039   typedef CFactoryBase base;
00040 
00041 public:
00043   typedef base::parent_type parent_type;
00044 
00046   typedef BooleSet value_type;
00047 
00049   SetFactory(const parent_type& ring): base(ring) {}
00050 
00052   SetFactory(const self& rhs): base(rhs)  {}
00053 
00055   ~SetFactory() {}
00056 
00058   value_type operator()() const {
00059     return value_type(parent());
00060   }
00061 
00063   value_type operator()(const value_type& rhs) const {
00064     return rhs;
00065   }
00066 
00068   value_type operator()(const value_type::ring_type& ring) const {
00069     return value_type(ring);
00070   }
00071 
00073   value_type operator()(value_type::idx_type idx, 
00074                         const value_type& first,
00075                         const value_type& second) const {
00076     return value_type(idx, first, second);
00077   }
00078 
00080   value_type operator()(value_type::idx_type idx, 
00081                         value_type::navigator first,
00082                         value_type::navigator second) const {
00083     return value_type(idx, first, second, parent());
00084   }
00085 
00087   value_type operator()(value_type::idx_type idx, 
00088                         value_type::navigator first,
00089                         value_type::navigator second,
00090                         value_type::ring_type& ring) const {
00091     return value_type(idx, first, second, ring);
00092   }
00093 
00095   value_type operator()(value_type::navigator navi,
00096                         value_type::ring_type& ring) const {
00097     return value_type(navi, ring);
00098   }
00099 
00101   value_type operator()(value_type::navigator navi) const {
00102     return value_type(navi, parent());
00103   }
00104 };
00105 
00106 END_NAMESPACE_PBORI
00107 
00108 #endif /* polybori_SetFactory_h_ */