CppExporter.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. Author: Juan Rada-Vilela, Ph.D.
  3. Copyright (C) 2010-2014 FuzzyLite Limited
  4. All rights reserved
  5. This file is part of fuzzylite.
  6. fuzzylite is free software: you can redistribute it and/or modify it under
  7. the terms of the GNU Lesser General Public License as published by the Free
  8. Software Foundation, either version 3 of the License, or (at your option)
  9. any later version.
  10. fuzzylite is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
  13. for more details.
  14. You should have received a copy of the GNU Lesser General Public License
  15. along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
  16. fuzzylite™ is a trademark of FuzzyLite Limited.
  17. */
  18. #ifndef FL_CPPEXPORTER_H
  19. #define FL_CPPEXPORTER_H
  20. #include "fl/imex/Exporter.h"
  21. namespace fl {
  22. class Engine;
  23. class InputVariable;
  24. class OutputVariable;
  25. class Term;
  26. class RuleBlock;
  27. class Norm;
  28. class Defuzzifier;
  29. class Hedge;
  30. class FL_API CppExporter : public Exporter {
  31. protected:
  32. bool _prefixNamespace;
  33. virtual std::string fl(const std::string& clazz) const;
  34. public:
  35. CppExporter(bool prefixNamespace = false);
  36. virtual ~CppExporter() FL_IOVERRIDE;
  37. FL_DEFAULT_COPY_AND_MOVE(CppExporter)
  38. virtual std::string name() const FL_IOVERRIDE;
  39. virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
  40. virtual std::string toString(const InputVariable* inputVariable, const Engine* engine) const;
  41. virtual std::string toString(const OutputVariable* outputVariable, const Engine* engine) const;
  42. virtual std::string toString(const RuleBlock* ruleBlock, const Engine* engine) const;
  43. virtual std::string toString(scalar value) const;
  44. virtual std::string toString(const Hedge* hedge) const;
  45. virtual std::string toString(const Term* term) const;
  46. virtual std::string toString(const Norm* op) const;
  47. virtual std::string toString(const Defuzzifier* defuzzifier) const;
  48. virtual CppExporter* clone() const FL_IOVERRIDE;
  49. };
  50. }
  51. #endif /* FL_CPPEXPORTER_H */