|
| 1 | +/** @file af_map.hpp |
| 2 | +
|
| 3 | + @brief <b>Map Abstract Factory</b> |
| 4 | +
|
| 5 | + It was proposed to try implementing SBG maps with "atomic" domains (i.e., |
| 6 | + the domain is a described with a mdi). For this reason, it was decided that |
| 7 | + delegation should be used to provide different implementations, and also an |
| 8 | + abstract factory was needed to create objects with the desired implementation. |
| 9 | +
|
| 10 | + <hr> |
| 11 | +
|
| 12 | + This file is part of Set--Based Graph Library. |
| 13 | +
|
| 14 | + SBG Library is free software: you can redistribute it and/or modify |
| 15 | + it under the terms of the GNU General Public License as published by |
| 16 | + the Free Software Foundation, either version 3 of the License, or |
| 17 | + (at your option) any later version. |
| 18 | +
|
| 19 | + SBG Library is distributed in the hope that it will be useful, |
| 20 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | + GNU General Public License for more details. |
| 23 | +
|
| 24 | + You should have received a copy of the GNU General Public License |
| 25 | + along with SBG Library. If not, see <http://www.gnu.org/licenses/>. |
| 26 | +
|
| 27 | + ******************************************************************************/ |
| 28 | + |
| 29 | +#ifndef SBG_AF_MAP_HPP |
| 30 | +#define SBG_AF_MAP_HPP |
| 31 | + |
| 32 | +#include "map.hpp" |
| 33 | + |
| 34 | +namespace SBG { |
| 35 | + |
| 36 | +namespace LIB { |
| 37 | + |
| 38 | +struct MapAF { |
| 39 | + virtual ~MapAF() = default; |
| 40 | + |
| 41 | + virtual Map createMap() const = 0; |
| 42 | + virtual Map createMap(Util::MD_NAT x, Exp exp) const = 0; |
| 43 | + virtual Map createMap(Interval i, LExp le) const = 0; |
| 44 | + virtual Map createMap(SetPiece mdi, Exp exp) const = 0; |
| 45 | + virtual Map createMap(Set s, Exp exp) const = 0; |
| 46 | +}; |
| 47 | + |
| 48 | +struct MapSetAF : public MapAF { |
| 49 | + private: |
| 50 | + const SetAF &set_fact_; |
| 51 | + |
| 52 | + public: |
| 53 | + MapSetAF(const SetAF &set_fact); |
| 54 | + |
| 55 | + Map createMap() const override; |
| 56 | + Map createMap(Util::MD_NAT x, Exp exp) const override; |
| 57 | + Map createMap(Interval i, LExp le) const override; |
| 58 | + Map createMap(SetPiece mdi, Exp exp) const override; |
| 59 | + Map createMap(Set s, Exp exp) const override; |
| 60 | +}; |
| 61 | + |
| 62 | +} // namespace LIB |
| 63 | + |
| 64 | +} // namespace SBG |
| 65 | + |
| 66 | +#endif |
0 commit comments