From c190cebf493f83a7460951415b73c36e4b8f153e Mon Sep 17 00:00:00 2001 From: fintarin Date: Sat, 6 Apr 2024 18:00:50 +0400 Subject: [PATCH] New MathObjectClass --- include/fintamath/core/IArithmetic.hpp | 2 +- include/fintamath/core/IComparable.hpp | 2 +- include/fintamath/core/IMathObject.hpp | 9 +- include/fintamath/core/IMathObjectCRTP.hpp | 2 +- include/fintamath/core/MathObjectBody.hpp | 39 +++---- include/fintamath/core/MathObjectClass.hpp | 82 ++++---------- .../fintamath/core/MathObjectIdStorage.hpp | 24 +++++ include/fintamath/core/MathObjectUtils.hpp | 85 +++++++-------- include/fintamath/core/None.hpp | 13 +++ include/fintamath/expressions/Expression.hpp | 4 +- include/fintamath/expressions/IExpression.hpp | 2 +- .../interfaces/IBinaryExpression.hpp | 2 +- .../interfaces/IPolynomExpression.hpp | 2 +- .../interfaces/IUnaryExpression.hpp | 2 +- include/fintamath/functions/IFunction.hpp | 6 +- include/fintamath/functions/IFunctionCRTP.hpp | 8 +- include/fintamath/functions/IOperator.hpp | 2 +- .../fintamath/functions/arithmetic/Abs.hpp | 4 +- .../fintamath/functions/arithmetic/Add.hpp | 4 +- .../functions/arithmetic/AddOper.hpp | 4 +- .../fintamath/functions/arithmetic/Div.hpp | 4 +- .../fintamath/functions/arithmetic/Frac.hpp | 4 +- .../functions/arithmetic/FracMixed.hpp | 4 +- .../fintamath/functions/arithmetic/Mul.hpp | 4 +- .../functions/arithmetic/MulOper.hpp | 4 +- .../fintamath/functions/arithmetic/Neg.hpp | 4 +- .../fintamath/functions/arithmetic/Sign.hpp | 4 +- .../fintamath/functions/arithmetic/Sub.hpp | 4 +- .../functions/arithmetic/UnaryPlus.hpp | 4 +- .../functions/calculus/Derivative.hpp | 4 +- .../fintamath/functions/calculus/Integral.hpp | 4 +- include/fintamath/functions/calculus/Max.hpp | 4 +- include/fintamath/functions/calculus/Min.hpp | 4 +- .../fintamath/functions/comparison/Eqv.hpp | 4 +- .../fintamath/functions/comparison/Less.hpp | 4 +- .../functions/comparison/LessEqv.hpp | 4 +- .../fintamath/functions/comparison/More.hpp | 4 +- .../functions/comparison/MoreEqv.hpp | 4 +- .../fintamath/functions/comparison/Neqv.hpp | 4 +- .../fintamath/functions/hyperbolic/Acosh.hpp | 4 +- .../fintamath/functions/hyperbolic/Acoth.hpp | 4 +- .../fintamath/functions/hyperbolic/Acsch.hpp | 4 +- .../fintamath/functions/hyperbolic/Asech.hpp | 4 +- .../fintamath/functions/hyperbolic/Asinh.hpp | 4 +- .../fintamath/functions/hyperbolic/Atanh.hpp | 4 +- .../fintamath/functions/hyperbolic/Cosh.hpp | 4 +- .../fintamath/functions/hyperbolic/Coth.hpp | 4 +- .../fintamath/functions/hyperbolic/Csch.hpp | 4 +- .../fintamath/functions/hyperbolic/Sech.hpp | 4 +- .../fintamath/functions/hyperbolic/Sinh.hpp | 4 +- .../fintamath/functions/hyperbolic/Tanh.hpp | 4 +- include/fintamath/functions/logarithms/Lb.hpp | 4 +- include/fintamath/functions/logarithms/Lg.hpp | 4 +- include/fintamath/functions/logarithms/Ln.hpp | 4 +- .../fintamath/functions/logarithms/Log.hpp | 4 +- include/fintamath/functions/logic/And.hpp | 4 +- include/fintamath/functions/logic/AndOper.hpp | 4 +- include/fintamath/functions/logic/Equiv.hpp | 4 +- include/fintamath/functions/logic/Impl.hpp | 4 +- include/fintamath/functions/logic/Nequiv.hpp | 4 +- include/fintamath/functions/logic/Not.hpp | 4 +- include/fintamath/functions/logic/Or.hpp | 4 +- include/fintamath/functions/logic/OrOper.hpp | 4 +- include/fintamath/functions/ntheory/Ceil.hpp | 4 +- include/fintamath/functions/ntheory/Floor.hpp | 4 +- include/fintamath/functions/ntheory/Mod.hpp | 4 +- include/fintamath/functions/other/Comma.hpp | 4 +- include/fintamath/functions/other/Deg.hpp | 4 +- .../fintamath/functions/other/Factorial.hpp | 4 +- include/fintamath/functions/other/Index.hpp | 4 +- include/fintamath/functions/other/Percent.hpp | 4 +- include/fintamath/functions/powers/Exp.hpp | 4 +- include/fintamath/functions/powers/Pow.hpp | 4 +- .../fintamath/functions/powers/PowOper.hpp | 4 +- include/fintamath/functions/powers/Root.hpp | 4 +- include/fintamath/functions/powers/Sqr.hpp | 4 +- include/fintamath/functions/powers/Sqrt.hpp | 4 +- .../fintamath/functions/trigonometry/Acos.hpp | 4 +- .../fintamath/functions/trigonometry/Acot.hpp | 4 +- .../fintamath/functions/trigonometry/Acsc.hpp | 4 +- .../fintamath/functions/trigonometry/Asec.hpp | 4 +- .../fintamath/functions/trigonometry/Asin.hpp | 4 +- .../fintamath/functions/trigonometry/Atan.hpp | 4 +- .../fintamath/functions/trigonometry/Cos.hpp | 4 +- .../fintamath/functions/trigonometry/Cot.hpp | 4 +- .../fintamath/functions/trigonometry/Csc.hpp | 4 +- .../fintamath/functions/trigonometry/Sec.hpp | 4 +- .../fintamath/functions/trigonometry/Sin.hpp | 4 +- .../fintamath/functions/trigonometry/Tan.hpp | 4 +- include/fintamath/literals/Boolean.hpp | 4 +- include/fintamath/literals/ILiteral.hpp | 2 +- include/fintamath/literals/Variable.hpp | 4 +- .../literals/constants/ComplexInf.hpp | 4 +- include/fintamath/literals/constants/E.hpp | 4 +- .../fintamath/literals/constants/False.hpp | 4 +- include/fintamath/literals/constants/I.hpp | 4 +- .../literals/constants/IConstant.hpp | 2 +- include/fintamath/literals/constants/Inf.hpp | 4 +- .../fintamath/literals/constants/NegInf.hpp | 4 +- include/fintamath/literals/constants/Pi.hpp | 4 +- include/fintamath/literals/constants/True.hpp | 4 +- .../literals/constants/Undefined.hpp | 4 +- include/fintamath/numbers/Complex.hpp | 4 +- include/fintamath/numbers/INumber.hpp | 2 +- include/fintamath/numbers/Integer.hpp | 4 +- include/fintamath/numbers/Rational.hpp | 4 +- include/fintamath/numbers/Real.hpp | 4 +- src/fintamath/core/MathObjectClass.cpp | 52 --------- src/fintamath/core/MathObjectIdStorage.cpp | 19 ++++ .../expressions/ExpressionComparator.cpp | 2 +- .../expressions/FunctionExpression.hpp | 4 +- src/fintamath/expressions/binary/CompExpr.hpp | 4 +- .../expressions/binary/DerivativeExpr.hpp | 4 +- src/fintamath/expressions/binary/DivExpr.hpp | 4 +- .../expressions/binary/IntegralExpr.hpp | 4 +- src/fintamath/expressions/binary/LogExpr.hpp | 4 +- src/fintamath/expressions/binary/PowExpr.hpp | 4 +- .../expressions/polynomial/AddExpr.hpp | 4 +- .../expressions/polynomial/AndExpr.hpp | 4 +- .../expressions/polynomial/MinMaxExpr.hpp | 4 +- .../expressions/polynomial/MulExpr.hpp | 4 +- .../expressions/polynomial/OrExpr.hpp | 4 +- src/fintamath/expressions/unary/AbsExpr.hpp | 4 +- .../expressions/unary/FloorCeilExpr.hpp | 4 +- .../expressions/unary/HyperbExpr.hpp | 4 +- .../expressions/unary/InvHyperbExpr.hpp | 4 +- .../expressions/unary/InvTrigExpr.hpp | 4 +- src/fintamath/expressions/unary/NotExpr.hpp | 4 +- src/fintamath/expressions/unary/SignExpr.hpp | 4 +- src/fintamath/expressions/unary/TrigExpr.hpp | 4 +- tests/src/core/IArithmeticTests.cpp | 8 +- tests/src/core/IComparableTests.cpp | 8 +- tests/src/core/IMathObjectTests.cpp | 12 +-- tests/src/core/MathObjectClassTests.cpp | 100 ++++++------------ tests/src/core/MathObjectUtilsTests.cpp | 4 +- tests/src/core/NoneTests.cpp | 9 ++ tests/src/expressions/ExpressionTests.cpp | 4 +- .../expressions/FunctionExpressionTests.cpp | 24 ++--- tests/src/expressions/IExpressionTests.cpp | 8 +- .../src/expressions/binary/CompExprTests.cpp | 4 +- .../binary/DerivativeExprTests.cpp | 4 +- tests/src/expressions/binary/DivExprTests.cpp | 4 +- .../expressions/binary/IntegralExprTests.cpp | 4 +- tests/src/expressions/binary/LogExprTests.cpp | 4 +- tests/src/expressions/binary/PowExprTests.cpp | 4 +- .../interfaces/IBinaryExpressionTests.cpp | 8 +- .../interfaces/IPolynomExpressionTests.cpp | 8 +- .../interfaces/IUnaryExpressionTests.cpp | 8 +- .../expressions/polynomial/AddExprTests.cpp | 4 +- .../expressions/polynomial/AndExprTests.cpp | 4 +- .../polynomial/MinMaxExprTests.cpp | 4 +- .../expressions/polynomial/MulExprTests.cpp | 4 +- .../expressions/polynomial/OrExprTests.cpp | 4 +- tests/src/expressions/unary/AbsExprTests.cpp | 4 +- .../expressions/unary/FloorCeilExprTests.cpp | 4 +- .../src/expressions/unary/HyperbExprTests.cpp | 4 +- .../expressions/unary/InvHyperbExprTests.cpp | 4 +- .../expressions/unary/InvTrigExprTests.cpp | 4 +- tests/src/expressions/unary/NotExprTests.cpp | 4 +- tests/src/expressions/unary/SignExprTests.cpp | 4 +- tests/src/expressions/unary/TrigExprTests.cpp | 4 +- tests/src/functions/IFunctionTests.cpp | 8 +- tests/src/functions/IOperatorTests.cpp | 8 +- tests/src/functions/arithmetic/AbsTests.cpp | 4 +- .../src/functions/arithmetic/AddOperTests.cpp | 4 +- tests/src/functions/arithmetic/AddTests.cpp | 4 +- tests/src/functions/arithmetic/DivTests.cpp | 4 +- .../functions/arithmetic/FracMixedTests.cpp | 4 +- tests/src/functions/arithmetic/FracTests.cpp | 4 +- .../src/functions/arithmetic/MulOperTests.cpp | 4 +- tests/src/functions/arithmetic/MulTests.cpp | 4 +- tests/src/functions/arithmetic/NegTests.cpp | 4 +- tests/src/functions/arithmetic/SignTests.cpp | 4 +- tests/src/functions/arithmetic/SubTests.cpp | 4 +- .../functions/arithmetic/UnaryPlusTests.cpp | 4 +- .../functions/calculus/DerivativeTests.cpp | 8 +- .../src/functions/calculus/IntegralTests.cpp | 4 +- tests/src/functions/calculus/MaxTests.cpp | 4 +- tests/src/functions/calculus/MinTests.cpp | 4 +- tests/src/functions/comparison/EqvTests.cpp | 4 +- .../src/functions/comparison/LessEqvTests.cpp | 4 +- tests/src/functions/comparison/LessTests.cpp | 4 +- .../src/functions/comparison/MoreEqvTests.cpp | 4 +- tests/src/functions/comparison/MoreTests.cpp | 4 +- tests/src/functions/comparison/NeqvTests.cpp | 4 +- tests/src/functions/hyperbolic/AcoshTests.cpp | 4 +- tests/src/functions/hyperbolic/AcothTests.cpp | 4 +- tests/src/functions/hyperbolic/AcschTests.cpp | 4 +- tests/src/functions/hyperbolic/AsechTests.cpp | 4 +- tests/src/functions/hyperbolic/AsinhTests.cpp | 4 +- tests/src/functions/hyperbolic/AtanhTests.cpp | 4 +- tests/src/functions/hyperbolic/CoshTests.cpp | 4 +- tests/src/functions/hyperbolic/CothTests.cpp | 4 +- tests/src/functions/hyperbolic/CschTests.cpp | 4 +- tests/src/functions/hyperbolic/SechTests.cpp | 4 +- tests/src/functions/hyperbolic/SinhTests.cpp | 4 +- tests/src/functions/hyperbolic/TanhTests.cpp | 4 +- tests/src/functions/logarithms/LbTests.cpp | 4 +- tests/src/functions/logarithms/LgTests.cpp | 4 +- tests/src/functions/logarithms/LnTests.cpp | 4 +- tests/src/functions/logarithms/LogTests.cpp | 4 +- tests/src/functions/logic/AndOperTests.cpp | 4 +- tests/src/functions/logic/AndTests.cpp | 4 +- tests/src/functions/logic/EquivTests.cpp | 4 +- tests/src/functions/logic/ImplTests.cpp | 4 +- tests/src/functions/logic/NequivTests.cpp | 4 +- tests/src/functions/logic/NotTests.cpp | 4 +- tests/src/functions/logic/OrOperTests.cpp | 4 +- tests/src/functions/logic/OrTests.cpp | 4 +- tests/src/functions/ntheory/CeilTests.cpp | 4 +- tests/src/functions/ntheory/FloorTests.cpp | 4 +- tests/src/functions/ntheory/ModTests.cpp | 4 +- tests/src/functions/other/CommaTests.cpp | 4 +- tests/src/functions/other/DegTests.cpp | 4 +- tests/src/functions/other/FactorialTests.cpp | 4 +- tests/src/functions/other/IndexTests.cpp | 4 +- tests/src/functions/other/PercentTests.cpp | 4 +- tests/src/functions/powers/ExpTests.cpp | 4 +- tests/src/functions/powers/PowOperTests.cpp | 4 +- tests/src/functions/powers/PowTests.cpp | 4 +- tests/src/functions/powers/RootTests.cpp | 4 +- tests/src/functions/powers/SqrTests.cpp | 4 +- tests/src/functions/powers/SqrtTests.cpp | 4 +- .../src/functions/trigonometry/AcosTests.cpp | 4 +- .../src/functions/trigonometry/AcotTests.cpp | 4 +- .../src/functions/trigonometry/AcscTests.cpp | 4 +- .../src/functions/trigonometry/AsecTests.cpp | 4 +- .../src/functions/trigonometry/AsinTests.cpp | 4 +- .../src/functions/trigonometry/AtanTests.cpp | 4 +- tests/src/functions/trigonometry/CosTests.cpp | 4 +- tests/src/functions/trigonometry/CotTests.cpp | 4 +- tests/src/functions/trigonometry/CscTests.cpp | 4 +- tests/src/functions/trigonometry/SecTests.cpp | 4 +- tests/src/functions/trigonometry/SinTests.cpp | 4 +- tests/src/functions/trigonometry/TanTests.cpp | 4 +- tests/src/literals/BooleanTests.cpp | 4 +- tests/src/literals/ILiteralTests.cpp | 8 +- tests/src/literals/VariableTests.cpp | 4 +- .../literals/constants/ComplexInfTests.cpp | 4 +- tests/src/literals/constants/ETests.cpp | 4 +- tests/src/literals/constants/FalseTests.cpp | 4 +- .../src/literals/constants/IConstantTests.cpp | 8 +- tests/src/literals/constants/ITests.cpp | 4 +- tests/src/literals/constants/InfTests.cpp | 4 +- tests/src/literals/constants/NegInfTests.cpp | 4 +- tests/src/literals/constants/PiTests.cpp | 4 +- tests/src/literals/constants/TrueTests.cpp | 4 +- .../src/literals/constants/UndefinedTests.cpp | 4 +- tests/src/numbers/ComplexTests.cpp | 4 +- tests/src/numbers/INumberTests.cpp | 8 +- tests/src/numbers/IntegerTests.cpp | 4 +- tests/src/numbers/RationalTests.cpp | 4 +- tests/src/numbers/RealTests.cpp | 4 +- 253 files changed, 693 insertions(+), 769 deletions(-) create mode 100644 include/fintamath/core/MathObjectIdStorage.hpp create mode 100644 include/fintamath/core/None.hpp delete mode 100644 src/fintamath/core/MathObjectClass.cpp create mode 100644 src/fintamath/core/MathObjectIdStorage.cpp create mode 100644 tests/src/core/NoneTests.cpp diff --git a/include/fintamath/core/IArithmetic.hpp b/include/fintamath/core/IArithmetic.hpp index e531d13e3..7d5375a48 100644 --- a/include/fintamath/core/IArithmetic.hpp +++ b/include/fintamath/core/IArithmetic.hpp @@ -13,7 +13,7 @@ namespace fintamath { class IArithmetic : public IMathObject { - FINTAMATH_PARENT_CLASS_BODY(IArithmetic) + FINTAMATH_PARENT_CLASS_BODY(IArithmetic, IMathObject) public: friend std::unique_ptr operator+(const IArithmetic &lhs, const IArithmetic &rhs) { diff --git a/include/fintamath/core/IComparable.hpp b/include/fintamath/core/IComparable.hpp index b8ed7be85..8a630f8bd 100644 --- a/include/fintamath/core/IComparable.hpp +++ b/include/fintamath/core/IComparable.hpp @@ -14,7 +14,7 @@ namespace fintamath { class IComparable : public IArithmetic { - FINTAMATH_PARENT_CLASS_BODY(IComparable) + FINTAMATH_PARENT_CLASS_BODY(IComparable, IArithmetic) public: friend std::strong_ordering operator<=>(const IComparable &lhs, const IComparable &rhs) { diff --git a/include/fintamath/core/IMathObject.hpp b/include/fintamath/core/IMathObject.hpp index 1d225c889..1dd87f4b3 100644 --- a/include/fintamath/core/IMathObject.hpp +++ b/include/fintamath/core/IMathObject.hpp @@ -10,29 +10,30 @@ #include "fintamath/core/MathObjectBody.hpp" #include "fintamath/core/MathObjectClass.hpp" #include "fintamath/core/MathObjectUtils.hpp" +#include "fintamath/core/None.hpp" #include "fintamath/core/Parser.hpp" namespace fintamath { class IMathObject { - FINTAMATH_PARENT_CLASS_BODY(IMathObject) + FINTAMATH_PARENT_CLASS_BODY(IMathObject, None) public: - virtual ~IMathObject() = default; + virtual ~IMathObject() noexcept = default; virtual std::unique_ptr clone() const & = 0; virtual std::unique_ptr clone() && = 0; virtual std::string toString() const { - return std::string(getClass().getName()); + return std::string(getClass()->getName()); } virtual std::unique_ptr toMinimalObject() const { return clone(); } - virtual MathObjectClass getClass() const = 0; + virtual MathObjectClass getClass() const noexcept = 0; friend bool operator==(const IMathObject &lhs, const IMathObject &rhs) { return lhs.equalsAbstract(rhs); diff --git a/include/fintamath/core/IMathObjectCRTP.hpp b/include/fintamath/core/IMathObjectCRTP.hpp index e7b386f83..6e1656f9f 100644 --- a/include/fintamath/core/IMathObjectCRTP.hpp +++ b/include/fintamath/core/IMathObjectCRTP.hpp @@ -22,7 +22,7 @@ class IMathObjectCRTP_ : public IMathObject { return equals(cast(rhs)); } - MathObjectClass getClass() const override { + MathObjectClass getClass() const noexcept override { return Derived::getClassStatic(); } diff --git a/include/fintamath/core/MathObjectBody.hpp b/include/fintamath/core/MathObjectBody.hpp index 8918b4b83..ccb3c6c44 100644 --- a/include/fintamath/core/MathObjectBody.hpp +++ b/include/fintamath/core/MathObjectBody.hpp @@ -3,43 +3,46 @@ #include #include "fintamath/core/MathObjectClass.hpp" +#include "fintamath/core/MathObjectIdStorage.hpp" #include "fintamath/core/Parser.hpp" -#define FINTAMATH_CLASS_BODY(Class) \ -public: \ - static constexpr MathObjectClass getClassStatic() { \ - return {#Class}; \ - } \ - \ -private: +#define FINTAMATH_CLASS_BODY(Class, Parent) \ +public: \ + static constexpr MathObjectClass getClassStatic() noexcept { \ + return &objClass; \ + } \ + \ +private: \ + static constexpr detail::MathObjectClassImpl \ + objClass{#Class, Parent::getClassStatic()}; -#define FINTAMATH_PARENT_CLASS_BODY(Class) \ - FINTAMATH_CLASS_BODY(Class) \ +#define FINTAMATH_PARENT_CLASS_BODY(Class, Parent) \ + FINTAMATH_CLASS_BODY(Class, Parent) \ \ private: \ using Class##Parser = detail::Parser>; \ \ - static Class##Parser &getParser(); \ + static Class##Parser &getParser() noexcept; \ \ public: \ - static auto parse(std::string str) { \ + static auto parse(std::string str) noexcept { \ return getParser().parse(std::move(str)); \ } \ \ - static auto parseFirst(std::string str) { \ + static auto parseFirst(std::string str) noexcept { \ return getParser().parseFirst(std::move(str)); \ } \ \ template T> \ - static void registerType() { \ - MathObjectClass::bindTypes(); \ + static void registerType() noexcept { \ + MathObjectIdStorage::add(T::getClassStatic()); \ getParser().registerType(); \ } \ \ private: -#define FINTAMATH_PARENT_CLASS_IMPLEMENTATION(Class) \ - Class::Class##Parser &Class::getParser() { \ - static Class##Parser parser; \ - return parser; \ +#define FINTAMATH_PARENT_CLASS_IMPLEMENTATION(Class) \ + Class::Class##Parser &Class::getParser() noexcept { \ + static Class##Parser parser; \ + return parser; \ } diff --git a/include/fintamath/core/MathObjectClass.hpp b/include/fintamath/core/MathObjectClass.hpp index cbbb233c3..3da87a3f9 100644 --- a/include/fintamath/core/MathObjectClass.hpp +++ b/include/fintamath/core/MathObjectClass.hpp @@ -11,92 +11,46 @@ namespace fintamath { -class MathObjectClass; +namespace detail { -} - -template <> -struct std::hash { - size_t operator()(const fintamath::MathObjectClass &rhs) const noexcept; -}; - -namespace fintamath { - -class MathObjectClass final { +class MathObjectClassImpl final { public: using Name = std::string_view; - using Id = size_t; + using Ptr = const MathObjectClassImpl *; - using Children = std::unordered_set; +public: + constexpr MathObjectClassImpl(const Name inName, const Ptr inParent = nullptr) noexcept + : name(inName), + parent(inParent) { + } -private: - using ClassToIdMap = std::unordered_map; + constexpr MathObjectClassImpl(const MathObjectClassImpl &) noexcept = delete; - using ChildToParentMap = std::unordered_map; + constexpr MathObjectClassImpl(MathObjectClassImpl &&) noexcept = delete; - using ParentToChildrenMap = std::unordered_map; + constexpr MathObjectClassImpl &operator=(const MathObjectClassImpl &) noexcept = delete; -public: - constexpr MathObjectClass(const Name inName) : name(inName) { - } + constexpr MathObjectClassImpl &operator=(MathObjectClassImpl &&) noexcept = delete; - constexpr Name getName() const { + constexpr Name getName() const noexcept { return name; } - constexpr bool operator==(const MathObjectClass rhs) const { - return name == rhs.name; + constexpr Ptr getParent() const noexcept { + return parent; } - std::strong_ordering operator<=>(MathObjectClass rhs) const; - - std::optional getParent() const; - - const Children &getChildren(bool recursive = false) const; - - template Child> - static void bindTypes(); - -private: - Id getId() const; - - static ClassToIdMap &getClassToIdMap(); - - static ChildToParentMap &getChildToParentMap(); - - static ParentToChildrenMap &getParentToChildrenMap(); - - static ParentToChildrenMap &getParentToRecursiveChildrenMap(); - private: Name name; - inline static Id maxId = 0; + Ptr parent; - [[maybe_unused]] inline static const detail::Config config; + [[maybe_unused]] inline static const Config config; }; -template Child> -void MathObjectClass::bindTypes() { - MathObjectClass parent = Parent::getClassStatic(); - MathObjectClass child = Child::getClassStatic(); - - getClassToIdMap()[parent] = ++maxId; - getClassToIdMap()[child] = ++maxId; - - getChildToParentMap().insert_or_assign(child, parent); - getParentToChildrenMap()[parent].emplace(child); - - for (std::optional superParent = child.getParent(); superParent; superParent = superParent->getParent()) { - Children &superParentChildren = getParentToRecursiveChildrenMap()[*superParent]; - superParentChildren.emplace(child); - superParentChildren.insert(child.getChildren().begin(), child.getChildren().end()); - } } -} +using MathObjectClass = detail::MathObjectClassImpl::Ptr; -inline size_t std::hash::operator()(const fintamath::MathObjectClass &rhs) const noexcept { - return std::hash{}(rhs.getName()); } diff --git a/include/fintamath/core/MathObjectIdStorage.hpp b/include/fintamath/core/MathObjectIdStorage.hpp new file mode 100644 index 000000000..643a696d3 --- /dev/null +++ b/include/fintamath/core/MathObjectIdStorage.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "fintamath/core/MathObjectClass.hpp" + +namespace fintamath { + +class MathObjectIdStorage { + using MathObjectClassToIdMap = std::unordered_map; + +public: + static size_t get(MathObjectClass objClass) noexcept; + + static void add(MathObjectClass objClass) noexcept; + +private: + static MathObjectClassToIdMap &getMap() noexcept; + +private: + static inline size_t maxId = 1; +}; + +} diff --git a/include/fintamath/core/MathObjectUtils.hpp b/include/fintamath/core/MathObjectUtils.hpp index 2fcd49c96..c5ede1f4c 100644 --- a/include/fintamath/core/MathObjectUtils.hpp +++ b/include/fintamath/core/MathObjectUtils.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -11,12 +12,18 @@ namespace fintamath { class IMathObject; -inline bool is(const MathObjectClass to, const MathObjectClass from) { - return to == from || to.getChildren(true).contains(from); +inline bool is(const MathObjectClass to, const MathObjectClass from) noexcept { + for (MathObjectClass parent = from; parent; parent = parent->getParent()) { + if (parent == to) { + return true; + } + } + + return false; } template To, std::derived_from From> -bool is(const From &from) { +inline bool is(const From &from) noexcept { if constexpr (std::is_base_of_v) { return true; } @@ -29,7 +36,7 @@ bool is(const From &from) { } template To, std::derived_from From> -bool is(const From *from) { +inline bool is(const From *from) noexcept { if (!from) { return false; } @@ -38,81 +45,65 @@ bool is(const From *from) { } template To, std::derived_from From> -bool is(const std::unique_ptr &from) { +inline bool is(const std::unique_ptr &from) noexcept { return is(from.get()); } template To, std::derived_from From> -bool is(const std::shared_ptr &from) { +inline bool is(const std::shared_ptr &from) noexcept { return is(from.get()); } template To, std::derived_from From> -bool is(const std::shared_ptr &from) { +inline bool is(const std::shared_ptr &from) noexcept { return is(from.get()); } template To, std::derived_from From> -bool is(const std::reference_wrapper &from) { +inline bool is(const std::reference_wrapper &from) noexcept { return is(from.get()); } template To, std::derived_from From> -bool is(const std::reference_wrapper &from) { +inline bool is(const std::reference_wrapper &from) noexcept { return is(from.get()); } template To, std::derived_from From> -const To &cast(const From &from) { - if constexpr (!std::is_base_of_v) { - if (!is(from)) { - throw std::bad_cast{}; - } - } - +inline const To &cast(const From &from) noexcept { + assert(is(from)); return static_cast(from); } template To, std::derived_from From> -To &cast(From &from) { - if constexpr (!std::is_base_of_v) { - if (!is(from)) { - throw std::bad_cast{}; - } - } - +inline To &cast(From &from) noexcept { + assert(is(from)); return static_cast(from); } template To, std::derived_from From> -const To *cast(const From *from) { - if constexpr (!std::is_base_of_v) { - if (!is(from)) { - return {}; - } +inline const To *cast(const From *from) noexcept { + if (!is(from)) { + return {}; } return static_cast(from); } template To, std::derived_from From> -To *cast(From *from) { - if constexpr (!std::is_base_of_v) { - if (!is(from)) { - return {}; - } +inline To *cast(From *from) noexcept { + if (!is(from)) { + return {}; } return static_cast(from); } template To, std::derived_from From> -std::unique_ptr cast(std::unique_ptr &&from) { - if constexpr (!std::is_base_of_v) { - if (!is(from)) { - from.reset(); - return {}; - } +inline std::unique_ptr cast(std::unique_ptr &&from) noexcept { + if (!is(from)) { + from.reset(); + return {}; } From *fromRawPtr = from.release(); @@ -121,19 +112,21 @@ std::unique_ptr cast(std::unique_ptr &&from) { } template To, std::derived_from From> -std::shared_ptr cast(const std::shared_ptr &from) { - if constexpr (!std::is_base_of_v) { - if (!is(from)) { - return {}; - } +inline std::shared_ptr cast(const std::shared_ptr &from) noexcept { + if (!is(from)) { + return {}; } return std::static_pointer_cast(from); } template To, std::derived_from From> -std::shared_ptr cast(const std::shared_ptr &from) { - return std::const_pointer_cast(cast(std::const_pointer_cast(from))); +inline std::shared_ptr cast(const std::shared_ptr &from) noexcept { + if (!is(from)) { + return {}; + } + + return std::static_pointer_cast(from); } } \ No newline at end of file diff --git a/include/fintamath/core/None.hpp b/include/fintamath/core/None.hpp new file mode 100644 index 000000000..797c8fefb --- /dev/null +++ b/include/fintamath/core/None.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include "MathObjectClass.hpp" + +namespace fintamath { + +struct None { + static constexpr MathObjectClass getClassStatic() { + return nullptr; + } +}; + +} diff --git a/include/fintamath/expressions/Expression.hpp b/include/fintamath/expressions/Expression.hpp index f47e34cda..f3dffa214 100644 --- a/include/fintamath/expressions/Expression.hpp +++ b/include/fintamath/expressions/Expression.hpp @@ -60,8 +60,8 @@ using OperandStack = std::stack>; } -class Expression final : public IExpressionCRTP { - FINTAMATH_CLASS_BODY(Expression) +class Expression : public IExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Expression, IExpression) using ExpressionConstructor = std::function(ArgumentPtrVector &&)>; diff --git a/include/fintamath/expressions/IExpression.hpp b/include/fintamath/expressions/IExpression.hpp index 21f47b3be..dfa5e44ff 100644 --- a/include/fintamath/expressions/IExpression.hpp +++ b/include/fintamath/expressions/IExpression.hpp @@ -18,7 +18,7 @@ namespace fintamath { class IExpression : public IMathObject { - FINTAMATH_PARENT_CLASS_BODY(IExpression) + FINTAMATH_PARENT_CLASS_BODY(IExpression, IMathObject) public: virtual const std::shared_ptr &getFunction() const = 0; diff --git a/include/fintamath/expressions/interfaces/IBinaryExpression.hpp b/include/fintamath/expressions/interfaces/IBinaryExpression.hpp index 7d65d6dc6..d03599628 100644 --- a/include/fintamath/expressions/interfaces/IBinaryExpression.hpp +++ b/include/fintamath/expressions/interfaces/IBinaryExpression.hpp @@ -14,7 +14,7 @@ namespace fintamath { class IBinaryExpression : public IExpression { - FINTAMATH_PARENT_CLASS_BODY(IBinaryExpression) + FINTAMATH_PARENT_CLASS_BODY(IBinaryExpression, IExpression) public: explicit IBinaryExpression(const IFunction &inFunc, ArgumentPtr lhs, ArgumentPtr rhs); diff --git a/include/fintamath/expressions/interfaces/IPolynomExpression.hpp b/include/fintamath/expressions/interfaces/IPolynomExpression.hpp index 6784a9a7b..c75d8a0c3 100644 --- a/include/fintamath/expressions/interfaces/IPolynomExpression.hpp +++ b/include/fintamath/expressions/interfaces/IPolynomExpression.hpp @@ -16,7 +16,7 @@ namespace fintamath { class IOperator; class IPolynomExpression : public IExpression { - FINTAMATH_PARENT_CLASS_BODY(IPolynomExpression) + FINTAMATH_PARENT_CLASS_BODY(IPolynomExpression, IExpression) public: explicit IPolynomExpression(const IFunction &inFunc, ArgumentPtrVector args); diff --git a/include/fintamath/expressions/interfaces/IUnaryExpression.hpp b/include/fintamath/expressions/interfaces/IUnaryExpression.hpp index fab8029a7..1e0d64406 100644 --- a/include/fintamath/expressions/interfaces/IUnaryExpression.hpp +++ b/include/fintamath/expressions/interfaces/IUnaryExpression.hpp @@ -14,7 +14,7 @@ namespace fintamath { class IUnaryExpression : public IExpression { - FINTAMATH_PARENT_CLASS_BODY(IUnaryExpression) + FINTAMATH_PARENT_CLASS_BODY(IUnaryExpression, IExpression) public: explicit IUnaryExpression(const IFunction &inFunc, ArgumentPtr rhs); diff --git a/include/fintamath/functions/IFunction.hpp b/include/fintamath/functions/IFunction.hpp index 11b32f349..9c18d92fa 100644 --- a/include/fintamath/functions/IFunction.hpp +++ b/include/fintamath/functions/IFunction.hpp @@ -18,14 +18,14 @@ namespace fintamath { class IFunction : public IMathObject { - FINTAMATH_PARENT_CLASS_BODY(IFunction) + FINTAMATH_PARENT_CLASS_BODY(IFunction, IMathObject) using ClassToOrderMap = std::unordered_map; public: - virtual const ArgumentTypeVector &getArgumentClasses() const = 0; + virtual const ArgumentTypeVector &getArgumentClasses() const noexcept = 0; - virtual MathObjectClass getReturnClass() const = 0; + virtual MathObjectClass getReturnClass() const noexcept = 0; virtual bool doArgsMatch(const ArgumentRefVector &argVect) const = 0; diff --git a/include/fintamath/functions/IFunctionCRTP.hpp b/include/fintamath/functions/IFunctionCRTP.hpp index 351509401..404cfdbbb 100644 --- a/include/fintamath/functions/IFunctionCRTP.hpp +++ b/include/fintamath/functions/IFunctionCRTP.hpp @@ -14,21 +14,21 @@ class IFunctionCRTP_ : public IFunction { #undef I_MATH_OBJECT_CRTP public: - static constexpr auto getArgumentClassesStatic() { + static constexpr auto getArgumentClassesStatic() noexcept { return std::array{Args::getClassStatic()...}; } - const std::vector &getArgumentClasses() const final { + const std::vector &getArgumentClasses() const noexcept final { constexpr auto argClassesArr = getArgumentClassesStatic(); static const std::vector argClassesVect(argClassesArr.begin(), argClassesArr.end()); return argClassesVect; } - static constexpr MathObjectClass getReturnClassStatic() { + static constexpr MathObjectClass getReturnClassStatic() noexcept { return Return::getClassStatic(); } - MathObjectClass getReturnClass() const final { + MathObjectClass getReturnClass() const noexcept final { return getReturnClassStatic(); } diff --git a/include/fintamath/functions/IOperator.hpp b/include/fintamath/functions/IOperator.hpp index 8f8e21dfe..7c5418014 100644 --- a/include/fintamath/functions/IOperator.hpp +++ b/include/fintamath/functions/IOperator.hpp @@ -13,7 +13,7 @@ namespace fintamath { class IOperator : public IFunction { - FINTAMATH_PARENT_CLASS_BODY(IOperator) + FINTAMATH_PARENT_CLASS_BODY(IOperator, IFunction) public: enum class Priority : uint8_t { diff --git a/include/fintamath/functions/arithmetic/Abs.hpp b/include/fintamath/functions/arithmetic/Abs.hpp index 2ab8df6c3..03a1481d9 100644 --- a/include/fintamath/functions/arithmetic/Abs.hpp +++ b/include/fintamath/functions/arithmetic/Abs.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Abs final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Abs) +class Abs : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Abs, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Add.hpp b/include/fintamath/functions/arithmetic/Add.hpp index 6f7764f88..59f57e843 100644 --- a/include/fintamath/functions/arithmetic/Add.hpp +++ b/include/fintamath/functions/arithmetic/Add.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Add final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Add) +class Add : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Add, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/AddOper.hpp b/include/fintamath/functions/arithmetic/AddOper.hpp index d592152d8..45ffc4ff3 100644 --- a/include/fintamath/functions/arithmetic/AddOper.hpp +++ b/include/fintamath/functions/arithmetic/AddOper.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class AddOper final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(AddOper) +class AddOper : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(AddOper, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Div.hpp b/include/fintamath/functions/arithmetic/Div.hpp index 7d9a47fff..072d1f193 100644 --- a/include/fintamath/functions/arithmetic/Div.hpp +++ b/include/fintamath/functions/arithmetic/Div.hpp @@ -15,8 +15,8 @@ namespace fintamath { class Integer; class INumber; -class Div final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Div) +class Div : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Div, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Frac.hpp b/include/fintamath/functions/arithmetic/Frac.hpp index 09fb77def..d9785016a 100644 --- a/include/fintamath/functions/arithmetic/Frac.hpp +++ b/include/fintamath/functions/arithmetic/Frac.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class Frac final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Frac) +class Frac : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Frac, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/FracMixed.hpp b/include/fintamath/functions/arithmetic/FracMixed.hpp index b828ead4a..2b765e6c1 100644 --- a/include/fintamath/functions/arithmetic/FracMixed.hpp +++ b/include/fintamath/functions/arithmetic/FracMixed.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class FracMixed final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(FracMixed) +class FracMixed : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(FracMixed, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Mul.hpp b/include/fintamath/functions/arithmetic/Mul.hpp index 399428792..d52b4be81 100644 --- a/include/fintamath/functions/arithmetic/Mul.hpp +++ b/include/fintamath/functions/arithmetic/Mul.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Mul final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Mul) +class Mul : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Mul, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/MulOper.hpp b/include/fintamath/functions/arithmetic/MulOper.hpp index 0d8a9ee81..d71d7f0c2 100644 --- a/include/fintamath/functions/arithmetic/MulOper.hpp +++ b/include/fintamath/functions/arithmetic/MulOper.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class MulOper final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(MulOper) +class MulOper : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(MulOper, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Neg.hpp b/include/fintamath/functions/arithmetic/Neg.hpp index 52b593f34..3a091b709 100644 --- a/include/fintamath/functions/arithmetic/Neg.hpp +++ b/include/fintamath/functions/arithmetic/Neg.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Neg final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Neg) +class Neg : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Neg, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Sign.hpp b/include/fintamath/functions/arithmetic/Sign.hpp index 475c8109d..aea2b2813 100644 --- a/include/fintamath/functions/arithmetic/Sign.hpp +++ b/include/fintamath/functions/arithmetic/Sign.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Sign final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sign) +class Sign : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sign, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/Sub.hpp b/include/fintamath/functions/arithmetic/Sub.hpp index 91239303d..97fa5b3af 100644 --- a/include/fintamath/functions/arithmetic/Sub.hpp +++ b/include/fintamath/functions/arithmetic/Sub.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Sub final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Sub) +class Sub : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sub, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/arithmetic/UnaryPlus.hpp b/include/fintamath/functions/arithmetic/UnaryPlus.hpp index 172f48735..dd94fa363 100644 --- a/include/fintamath/functions/arithmetic/UnaryPlus.hpp +++ b/include/fintamath/functions/arithmetic/UnaryPlus.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class UnaryPlus final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(UnaryPlus) +class UnaryPlus : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(UnaryPlus, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/calculus/Derivative.hpp b/include/fintamath/functions/calculus/Derivative.hpp index a924a9646..48e885d85 100644 --- a/include/fintamath/functions/calculus/Derivative.hpp +++ b/include/fintamath/functions/calculus/Derivative.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class Derivative final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Derivative) +class Derivative : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Derivative, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/calculus/Integral.hpp b/include/fintamath/functions/calculus/Integral.hpp index deaae948f..3809f9233 100644 --- a/include/fintamath/functions/calculus/Integral.hpp +++ b/include/fintamath/functions/calculus/Integral.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class Integral final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Integral) +class Integral : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Integral, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/calculus/Max.hpp b/include/fintamath/functions/calculus/Max.hpp index 5d491dafb..d62986de8 100644 --- a/include/fintamath/functions/calculus/Max.hpp +++ b/include/fintamath/functions/calculus/Max.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Max final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Max) +class Max : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Max, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/calculus/Min.hpp b/include/fintamath/functions/calculus/Min.hpp index d42a205b7..36f9011d9 100644 --- a/include/fintamath/functions/calculus/Min.hpp +++ b/include/fintamath/functions/calculus/Min.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Min final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Min) +class Min : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Min, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/comparison/Eqv.hpp b/include/fintamath/functions/comparison/Eqv.hpp index 3b115b6b3..434d7aafd 100644 --- a/include/fintamath/functions/comparison/Eqv.hpp +++ b/include/fintamath/functions/comparison/Eqv.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class Eqv final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Eqv) +class Eqv : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Eqv, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/comparison/Less.hpp b/include/fintamath/functions/comparison/Less.hpp index d720206c0..2c6c53dde 100644 --- a/include/fintamath/functions/comparison/Less.hpp +++ b/include/fintamath/functions/comparison/Less.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class Less final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Less) +class Less : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Less, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/comparison/LessEqv.hpp b/include/fintamath/functions/comparison/LessEqv.hpp index 639d28a78..72914c06e 100644 --- a/include/fintamath/functions/comparison/LessEqv.hpp +++ b/include/fintamath/functions/comparison/LessEqv.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class LessEqv final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(LessEqv) +class LessEqv : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(LessEqv, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/comparison/More.hpp b/include/fintamath/functions/comparison/More.hpp index aab27c8ba..8b22ca1fd 100644 --- a/include/fintamath/functions/comparison/More.hpp +++ b/include/fintamath/functions/comparison/More.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class More final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(More) +class More : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(More, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/comparison/MoreEqv.hpp b/include/fintamath/functions/comparison/MoreEqv.hpp index 954edfbfb..2712830ee 100644 --- a/include/fintamath/functions/comparison/MoreEqv.hpp +++ b/include/fintamath/functions/comparison/MoreEqv.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class MoreEqv final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(MoreEqv) +class MoreEqv : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(MoreEqv, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/comparison/Neqv.hpp b/include/fintamath/functions/comparison/Neqv.hpp index 92324b196..97bb1aabf 100644 --- a/include/fintamath/functions/comparison/Neqv.hpp +++ b/include/fintamath/functions/comparison/Neqv.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class Neqv final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Neqv) +class Neqv : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Neqv, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Acosh.hpp b/include/fintamath/functions/hyperbolic/Acosh.hpp index ed67c828e..d5523dcc6 100644 --- a/include/fintamath/functions/hyperbolic/Acosh.hpp +++ b/include/fintamath/functions/hyperbolic/Acosh.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Acosh final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Acosh) +class Acosh : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Acosh, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Acoth.hpp b/include/fintamath/functions/hyperbolic/Acoth.hpp index 2b0aafe95..3d0769382 100644 --- a/include/fintamath/functions/hyperbolic/Acoth.hpp +++ b/include/fintamath/functions/hyperbolic/Acoth.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Acoth final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Acoth) +class Acoth : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Acoth, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Acsch.hpp b/include/fintamath/functions/hyperbolic/Acsch.hpp index 523e6fd4c..c1c0f3292 100644 --- a/include/fintamath/functions/hyperbolic/Acsch.hpp +++ b/include/fintamath/functions/hyperbolic/Acsch.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Acsch final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Acsch) +class Acsch : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Acsch, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Asech.hpp b/include/fintamath/functions/hyperbolic/Asech.hpp index 7e1eba0dd..be547870e 100644 --- a/include/fintamath/functions/hyperbolic/Asech.hpp +++ b/include/fintamath/functions/hyperbolic/Asech.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Asech final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Asech) +class Asech : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Asech, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Asinh.hpp b/include/fintamath/functions/hyperbolic/Asinh.hpp index 551861a8d..97e536aeb 100644 --- a/include/fintamath/functions/hyperbolic/Asinh.hpp +++ b/include/fintamath/functions/hyperbolic/Asinh.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Asinh final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Asinh) +class Asinh : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Asinh, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Atanh.hpp b/include/fintamath/functions/hyperbolic/Atanh.hpp index a6cf9eb1d..4643f0c31 100644 --- a/include/fintamath/functions/hyperbolic/Atanh.hpp +++ b/include/fintamath/functions/hyperbolic/Atanh.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Atanh final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Atanh) +class Atanh : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Atanh, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Cosh.hpp b/include/fintamath/functions/hyperbolic/Cosh.hpp index 56c28aea3..bf008a9d7 100644 --- a/include/fintamath/functions/hyperbolic/Cosh.hpp +++ b/include/fintamath/functions/hyperbolic/Cosh.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Cosh final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Cosh) +class Cosh : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Cosh, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Coth.hpp b/include/fintamath/functions/hyperbolic/Coth.hpp index ce9427450..3e65fe9c8 100644 --- a/include/fintamath/functions/hyperbolic/Coth.hpp +++ b/include/fintamath/functions/hyperbolic/Coth.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Coth final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Coth) +class Coth : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Coth, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Csch.hpp b/include/fintamath/functions/hyperbolic/Csch.hpp index ee54f4c2b..b5af15c32 100644 --- a/include/fintamath/functions/hyperbolic/Csch.hpp +++ b/include/fintamath/functions/hyperbolic/Csch.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Csch final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Csch) +class Csch : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Csch, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Sech.hpp b/include/fintamath/functions/hyperbolic/Sech.hpp index f6ed88872..ec21bdfe8 100644 --- a/include/fintamath/functions/hyperbolic/Sech.hpp +++ b/include/fintamath/functions/hyperbolic/Sech.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Sech final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sech) +class Sech : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sech, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Sinh.hpp b/include/fintamath/functions/hyperbolic/Sinh.hpp index 8331e9516..dfa6f2f86 100644 --- a/include/fintamath/functions/hyperbolic/Sinh.hpp +++ b/include/fintamath/functions/hyperbolic/Sinh.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Sinh final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sinh) +class Sinh : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sinh, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/hyperbolic/Tanh.hpp b/include/fintamath/functions/hyperbolic/Tanh.hpp index fb2886ed3..1cf372f66 100644 --- a/include/fintamath/functions/hyperbolic/Tanh.hpp +++ b/include/fintamath/functions/hyperbolic/Tanh.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Tanh final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Tanh) +class Tanh : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Tanh, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logarithms/Lb.hpp b/include/fintamath/functions/logarithms/Lb.hpp index d90568704..f5b9f229c 100644 --- a/include/fintamath/functions/logarithms/Lb.hpp +++ b/include/fintamath/functions/logarithms/Lb.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Lb final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Lb) +class Lb : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Lb, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logarithms/Lg.hpp b/include/fintamath/functions/logarithms/Lg.hpp index b3ff5c05f..12387d683 100644 --- a/include/fintamath/functions/logarithms/Lg.hpp +++ b/include/fintamath/functions/logarithms/Lg.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Lg final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Lg) +class Lg : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Lg, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logarithms/Ln.hpp b/include/fintamath/functions/logarithms/Ln.hpp index fb05931e7..6cbd08c47 100644 --- a/include/fintamath/functions/logarithms/Ln.hpp +++ b/include/fintamath/functions/logarithms/Ln.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Ln final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Ln) +class Ln : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Ln, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logarithms/Log.hpp b/include/fintamath/functions/logarithms/Log.hpp index 12c6fb427..63e5574f0 100644 --- a/include/fintamath/functions/logarithms/Log.hpp +++ b/include/fintamath/functions/logarithms/Log.hpp @@ -15,8 +15,8 @@ namespace fintamath { -class Log final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Log) +class Log : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Log, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/And.hpp b/include/fintamath/functions/logic/And.hpp index 5c739c046..4bd41d722 100644 --- a/include/fintamath/functions/logic/And.hpp +++ b/include/fintamath/functions/logic/And.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class And final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(And) +class And : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(And, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/AndOper.hpp b/include/fintamath/functions/logic/AndOper.hpp index 2ab2817e0..98ac8cd1b 100644 --- a/include/fintamath/functions/logic/AndOper.hpp +++ b/include/fintamath/functions/logic/AndOper.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class AndOper final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(AndOper) +class AndOper : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(AndOper, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/Equiv.hpp b/include/fintamath/functions/logic/Equiv.hpp index 2022f5e26..2424ab525 100644 --- a/include/fintamath/functions/logic/Equiv.hpp +++ b/include/fintamath/functions/logic/Equiv.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Equiv final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Equiv) +class Equiv : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Equiv, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/Impl.hpp b/include/fintamath/functions/logic/Impl.hpp index 8b8598b0a..867be101d 100644 --- a/include/fintamath/functions/logic/Impl.hpp +++ b/include/fintamath/functions/logic/Impl.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Impl final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Impl) +class Impl : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Impl, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/Nequiv.hpp b/include/fintamath/functions/logic/Nequiv.hpp index 41f5fa9d9..845ad3901 100644 --- a/include/fintamath/functions/logic/Nequiv.hpp +++ b/include/fintamath/functions/logic/Nequiv.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Nequiv final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Nequiv) +class Nequiv : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Nequiv, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/Not.hpp b/include/fintamath/functions/logic/Not.hpp index 768a75251..33edbf24e 100644 --- a/include/fintamath/functions/logic/Not.hpp +++ b/include/fintamath/functions/logic/Not.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Not final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Not) +class Not : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Not, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/Or.hpp b/include/fintamath/functions/logic/Or.hpp index 4148ff857..31001e6e3 100644 --- a/include/fintamath/functions/logic/Or.hpp +++ b/include/fintamath/functions/logic/Or.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Or final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Or) +class Or : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Or, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/logic/OrOper.hpp b/include/fintamath/functions/logic/OrOper.hpp index 7fd66d496..af09e8cdc 100644 --- a/include/fintamath/functions/logic/OrOper.hpp +++ b/include/fintamath/functions/logic/OrOper.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class OrOper final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(OrOper) +class OrOper : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(OrOper, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/ntheory/Ceil.hpp b/include/fintamath/functions/ntheory/Ceil.hpp index cf41064f9..669c27120 100644 --- a/include/fintamath/functions/ntheory/Ceil.hpp +++ b/include/fintamath/functions/ntheory/Ceil.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Ceil final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Ceil) +class Ceil : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Ceil, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/ntheory/Floor.hpp b/include/fintamath/functions/ntheory/Floor.hpp index 9344450dd..dab5adc72 100644 --- a/include/fintamath/functions/ntheory/Floor.hpp +++ b/include/fintamath/functions/ntheory/Floor.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Floor final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Floor) +class Floor : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Floor, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/ntheory/Mod.hpp b/include/fintamath/functions/ntheory/Mod.hpp index a581023b1..0e06e839c 100644 --- a/include/fintamath/functions/ntheory/Mod.hpp +++ b/include/fintamath/functions/ntheory/Mod.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Mod final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Mod) +class Mod : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Mod, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/other/Comma.hpp b/include/fintamath/functions/other/Comma.hpp index 7ac4fd0b1..507b219f6 100644 --- a/include/fintamath/functions/other/Comma.hpp +++ b/include/fintamath/functions/other/Comma.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class Comma final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Comma) +class Comma : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Comma, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/other/Deg.hpp b/include/fintamath/functions/other/Deg.hpp index 0044c627a..0c3a1452d 100644 --- a/include/fintamath/functions/other/Deg.hpp +++ b/include/fintamath/functions/other/Deg.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Deg final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Deg) +class Deg : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Deg, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/other/Factorial.hpp b/include/fintamath/functions/other/Factorial.hpp index 4305359b5..50e75fb14 100644 --- a/include/fintamath/functions/other/Factorial.hpp +++ b/include/fintamath/functions/other/Factorial.hpp @@ -18,8 +18,8 @@ class Integer; class Rational; class Real; -class Factorial final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Factorial) +class Factorial : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Factorial, IOperator) public: Factorial() = default; diff --git a/include/fintamath/functions/other/Index.hpp b/include/fintamath/functions/other/Index.hpp index bea96eec9..d4cb3e800 100644 --- a/include/fintamath/functions/other/Index.hpp +++ b/include/fintamath/functions/other/Index.hpp @@ -13,8 +13,8 @@ namespace fintamath { -class Index final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Index) +class Index : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Index, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/other/Percent.hpp b/include/fintamath/functions/other/Percent.hpp index ad55fcf73..b573fb720 100644 --- a/include/fintamath/functions/other/Percent.hpp +++ b/include/fintamath/functions/other/Percent.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Percent final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(Percent) +class Percent : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(Percent, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/powers/Exp.hpp b/include/fintamath/functions/powers/Exp.hpp index c4e389b0b..499c68ea6 100644 --- a/include/fintamath/functions/powers/Exp.hpp +++ b/include/fintamath/functions/powers/Exp.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Exp final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Exp) +class Exp : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Exp, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/powers/Pow.hpp b/include/fintamath/functions/powers/Pow.hpp index 5fc4772ad..394f7c4b8 100644 --- a/include/fintamath/functions/powers/Pow.hpp +++ b/include/fintamath/functions/powers/Pow.hpp @@ -17,8 +17,8 @@ class Rational; class Real; class Complex; -class Pow final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Pow) +class Pow : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Pow, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/powers/PowOper.hpp b/include/fintamath/functions/powers/PowOper.hpp index 91b4cc4b3..0e9bd8572 100644 --- a/include/fintamath/functions/powers/PowOper.hpp +++ b/include/fintamath/functions/powers/PowOper.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class PowOper final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(PowOper) +class PowOper : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(PowOper, IOperator) public: std::string toString() const override { diff --git a/include/fintamath/functions/powers/Root.hpp b/include/fintamath/functions/powers/Root.hpp index 05b77fe01..dceb412b0 100644 --- a/include/fintamath/functions/powers/Root.hpp +++ b/include/fintamath/functions/powers/Root.hpp @@ -17,8 +17,8 @@ class Integer; class Rational; class Real; -class Root final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Root) +class Root : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Root, IFunction) using RootToFactorMap = std::map; diff --git a/include/fintamath/functions/powers/Sqr.hpp b/include/fintamath/functions/powers/Sqr.hpp index a53051db4..e8db421f9 100644 --- a/include/fintamath/functions/powers/Sqr.hpp +++ b/include/fintamath/functions/powers/Sqr.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Sqr final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sqr) +class Sqr : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sqr, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/powers/Sqrt.hpp b/include/fintamath/functions/powers/Sqrt.hpp index 1d360cb8a..da4d5f9f1 100644 --- a/include/fintamath/functions/powers/Sqrt.hpp +++ b/include/fintamath/functions/powers/Sqrt.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Sqrt final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sqrt) +class Sqrt : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sqrt, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Acos.hpp b/include/fintamath/functions/trigonometry/Acos.hpp index 65eea4330..c681ca85f 100644 --- a/include/fintamath/functions/trigonometry/Acos.hpp +++ b/include/fintamath/functions/trigonometry/Acos.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Acos final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Acos) +class Acos : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Acos, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Acot.hpp b/include/fintamath/functions/trigonometry/Acot.hpp index 6729bb50e..177ffaa83 100644 --- a/include/fintamath/functions/trigonometry/Acot.hpp +++ b/include/fintamath/functions/trigonometry/Acot.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Acot final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Acot) +class Acot : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Acot, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Acsc.hpp b/include/fintamath/functions/trigonometry/Acsc.hpp index 816199d74..2680ebafe 100644 --- a/include/fintamath/functions/trigonometry/Acsc.hpp +++ b/include/fintamath/functions/trigonometry/Acsc.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Acsc final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Acsc) +class Acsc : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Acsc, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Asec.hpp b/include/fintamath/functions/trigonometry/Asec.hpp index 85030f466..4cee8df95 100644 --- a/include/fintamath/functions/trigonometry/Asec.hpp +++ b/include/fintamath/functions/trigonometry/Asec.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Asec final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Asec) +class Asec : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Asec, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Asin.hpp b/include/fintamath/functions/trigonometry/Asin.hpp index df451eb8b..8977fd312 100644 --- a/include/fintamath/functions/trigonometry/Asin.hpp +++ b/include/fintamath/functions/trigonometry/Asin.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Asin final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Asin) +class Asin : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Asin, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Atan.hpp b/include/fintamath/functions/trigonometry/Atan.hpp index 86f70c35d..60c6809e6 100644 --- a/include/fintamath/functions/trigonometry/Atan.hpp +++ b/include/fintamath/functions/trigonometry/Atan.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class Atan final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Atan) +class Atan : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Atan, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Cos.hpp b/include/fintamath/functions/trigonometry/Cos.hpp index 29f5c7193..cb673a59d 100644 --- a/include/fintamath/functions/trigonometry/Cos.hpp +++ b/include/fintamath/functions/trigonometry/Cos.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Cos final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Cos) +class Cos : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Cos, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Cot.hpp b/include/fintamath/functions/trigonometry/Cot.hpp index dbb785145..1bc070978 100644 --- a/include/fintamath/functions/trigonometry/Cot.hpp +++ b/include/fintamath/functions/trigonometry/Cot.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Cot final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Cot) +class Cot : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Cot, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Csc.hpp b/include/fintamath/functions/trigonometry/Csc.hpp index b459c02d2..4d5d7c86d 100644 --- a/include/fintamath/functions/trigonometry/Csc.hpp +++ b/include/fintamath/functions/trigonometry/Csc.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Csc final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Csc) +class Csc : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Csc, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Sec.hpp b/include/fintamath/functions/trigonometry/Sec.hpp index 90d31543c..3ae8cea5a 100644 --- a/include/fintamath/functions/trigonometry/Sec.hpp +++ b/include/fintamath/functions/trigonometry/Sec.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Sec final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sec) +class Sec : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sec, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Sin.hpp b/include/fintamath/functions/trigonometry/Sin.hpp index 34c761adc..86f45e1e8 100644 --- a/include/fintamath/functions/trigonometry/Sin.hpp +++ b/include/fintamath/functions/trigonometry/Sin.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Sin final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Sin) +class Sin : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Sin, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/functions/trigonometry/Tan.hpp b/include/fintamath/functions/trigonometry/Tan.hpp index 0ef5bde12..106ca308a 100644 --- a/include/fintamath/functions/trigonometry/Tan.hpp +++ b/include/fintamath/functions/trigonometry/Tan.hpp @@ -14,8 +14,8 @@ namespace fintamath { class Real; -class Tan final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(Tan) +class Tan : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(Tan, IFunction) public: std::string toString() const override { diff --git a/include/fintamath/literals/Boolean.hpp b/include/fintamath/literals/Boolean.hpp index 7c752d389..88885bbbe 100644 --- a/include/fintamath/literals/Boolean.hpp +++ b/include/fintamath/literals/Boolean.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class Boolean final : public ILiteralCRTP { - FINTAMATH_CLASS_BODY(Boolean) +class Boolean : public ILiteralCRTP { + FINTAMATH_PARENT_CLASS_BODY(Boolean, ILiteral) public: Boolean(); diff --git a/include/fintamath/literals/ILiteral.hpp b/include/fintamath/literals/ILiteral.hpp index 9b9b7fc97..7cb1e4fff 100644 --- a/include/fintamath/literals/ILiteral.hpp +++ b/include/fintamath/literals/ILiteral.hpp @@ -12,7 +12,7 @@ namespace fintamath { class ILiteral : public IMathObject { - FINTAMATH_PARENT_CLASS_BODY(ILiteral) + FINTAMATH_PARENT_CLASS_BODY(ILiteral, IMathObject) }; template diff --git a/include/fintamath/literals/Variable.hpp b/include/fintamath/literals/Variable.hpp index a879e6fb9..c1fd5e6f9 100644 --- a/include/fintamath/literals/Variable.hpp +++ b/include/fintamath/literals/Variable.hpp @@ -8,8 +8,8 @@ namespace fintamath { -class Variable final : public ILiteralCRTP { - FINTAMATH_CLASS_BODY(Variable) +class Variable : public ILiteralCRTP { + FINTAMATH_PARENT_CLASS_BODY(Variable, ILiteral) public: explicit Variable(std::string inName); diff --git a/include/fintamath/literals/constants/ComplexInf.hpp b/include/fintamath/literals/constants/ComplexInf.hpp index 80ae57ed1..35ea13b6a 100644 --- a/include/fintamath/literals/constants/ComplexInf.hpp +++ b/include/fintamath/literals/constants/ComplexInf.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class ComplexInf final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(ComplexInf) +class ComplexInf : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(ComplexInf, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/E.hpp b/include/fintamath/literals/constants/E.hpp index 50eb52f50..82d8c6a6e 100644 --- a/include/fintamath/literals/constants/E.hpp +++ b/include/fintamath/literals/constants/E.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class E final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(E) +class E : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(E, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/False.hpp b/include/fintamath/literals/constants/False.hpp index 44f565456..8233b9e0e 100644 --- a/include/fintamath/literals/constants/False.hpp +++ b/include/fintamath/literals/constants/False.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class False final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(False) +class False : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(False, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/I.hpp b/include/fintamath/literals/constants/I.hpp index 23805d11d..c9db051f5 100644 --- a/include/fintamath/literals/constants/I.hpp +++ b/include/fintamath/literals/constants/I.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class I final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(I) +class I : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(I, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/IConstant.hpp b/include/fintamath/literals/constants/IConstant.hpp index b641d5fcc..2ee5a0a6a 100644 --- a/include/fintamath/literals/constants/IConstant.hpp +++ b/include/fintamath/literals/constants/IConstant.hpp @@ -12,7 +12,7 @@ namespace fintamath { class IConstant : public ILiteral { - FINTAMATH_PARENT_CLASS_BODY(IConstant) + FINTAMATH_PARENT_CLASS_BODY(IConstant, ILiteral) public: virtual MathObjectClass getReturnClass() const = 0; diff --git a/include/fintamath/literals/constants/Inf.hpp b/include/fintamath/literals/constants/Inf.hpp index 09f0f7141..949bbb376 100644 --- a/include/fintamath/literals/constants/Inf.hpp +++ b/include/fintamath/literals/constants/Inf.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class Inf final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(Inf) +class Inf : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(Inf, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/NegInf.hpp b/include/fintamath/literals/constants/NegInf.hpp index aa2aea146..b0f79398f 100644 --- a/include/fintamath/literals/constants/NegInf.hpp +++ b/include/fintamath/literals/constants/NegInf.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class NegInf final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(NegInf) +class NegInf : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(NegInf, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/Pi.hpp b/include/fintamath/literals/constants/Pi.hpp index b586cfc78..e5f161ba8 100644 --- a/include/fintamath/literals/constants/Pi.hpp +++ b/include/fintamath/literals/constants/Pi.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class Pi final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(Pi) +class Pi : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(Pi, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/True.hpp b/include/fintamath/literals/constants/True.hpp index 5fc092b39..fc01e3f7c 100644 --- a/include/fintamath/literals/constants/True.hpp +++ b/include/fintamath/literals/constants/True.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class True final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(True) +class True : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(True, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/literals/constants/Undefined.hpp b/include/fintamath/literals/constants/Undefined.hpp index 116f4427d..b61683178 100644 --- a/include/fintamath/literals/constants/Undefined.hpp +++ b/include/fintamath/literals/constants/Undefined.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class Undefined final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(Undefined) +class Undefined : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(Undefined, IConstant) public: std::string toString() const override { diff --git a/include/fintamath/numbers/Complex.hpp b/include/fintamath/numbers/Complex.hpp index e34bfde6a..d25616105 100644 --- a/include/fintamath/numbers/Complex.hpp +++ b/include/fintamath/numbers/Complex.hpp @@ -14,8 +14,8 @@ namespace fintamath { -class Complex final : public INumberCRTP { - FINTAMATH_CLASS_BODY(Complex) +class Complex : public INumberCRTP { + FINTAMATH_PARENT_CLASS_BODY(Complex, INumber) public: Complex() = default; diff --git a/include/fintamath/numbers/INumber.hpp b/include/fintamath/numbers/INumber.hpp index de33d7f0e..80998ca6e 100644 --- a/include/fintamath/numbers/INumber.hpp +++ b/include/fintamath/numbers/INumber.hpp @@ -14,7 +14,7 @@ namespace fintamath { class INumber : public IComparable { - FINTAMATH_PARENT_CLASS_BODY(INumber) + FINTAMATH_PARENT_CLASS_BODY(INumber, IComparable) public: virtual bool isPrecise() const { diff --git a/include/fintamath/numbers/Integer.hpp b/include/fintamath/numbers/Integer.hpp index 27e13929b..c7f0f37f4 100644 --- a/include/fintamath/numbers/Integer.hpp +++ b/include/fintamath/numbers/Integer.hpp @@ -16,8 +16,8 @@ namespace fintamath { -class Integer final : public INumberCRTP { - FINTAMATH_CLASS_BODY(Integer) +class Integer : public INumberCRTP { + FINTAMATH_PARENT_CLASS_BODY(Integer, INumber) public: using Backend = boost::multiprecision::mpz_int; diff --git a/include/fintamath/numbers/Rational.hpp b/include/fintamath/numbers/Rational.hpp index 181a8a563..36698e943 100644 --- a/include/fintamath/numbers/Rational.hpp +++ b/include/fintamath/numbers/Rational.hpp @@ -14,8 +14,8 @@ namespace fintamath { -class Rational final : public INumberCRTP { - FINTAMATH_CLASS_BODY(Rational) +class Rational : public INumberCRTP { + FINTAMATH_PARENT_CLASS_BODY(Rational, INumber) public: Rational() = default; diff --git a/include/fintamath/numbers/Real.hpp b/include/fintamath/numbers/Real.hpp index ffa942fc5..d3a836600 100644 --- a/include/fintamath/numbers/Real.hpp +++ b/include/fintamath/numbers/Real.hpp @@ -19,8 +19,8 @@ namespace fintamath { -class Real final : public INumberCRTP { - FINTAMATH_CLASS_BODY(Real) +class Real : public INumberCRTP { + FINTAMATH_PARENT_CLASS_BODY(Real, INumber) public: using Backend = boost::multiprecision::mpfr_float; diff --git a/src/fintamath/core/MathObjectClass.cpp b/src/fintamath/core/MathObjectClass.cpp deleted file mode 100644 index eb073ac6f..000000000 --- a/src/fintamath/core/MathObjectClass.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "fintamath/core/MathObjectClass.hpp" - -namespace fintamath { - -std::strong_ordering MathObjectClass::operator<=>(const MathObjectClass rhs) const { - const Id lhsId = getId(); - const Id rhsId = rhs.getId(); - - return lhsId != 0 && rhsId != 0 - ? lhsId <=> rhsId - : name <=> rhs.name; -} - -std::optional MathObjectClass::getParent() const { - const auto iter = getChildToParentMap().find(name); - return iter != getChildToParentMap().end() ? iter->second : std::optional{}; -} - -const MathObjectClass::Children &MathObjectClass::getChildren(const bool recursive) const { - if (recursive) { - return getParentToRecursiveChildrenMap()[name]; - } - - return getParentToChildrenMap()[name]; -} - -MathObjectClass::Id MathObjectClass::getId() const { - const auto classToId = getClassToIdMap().find(*this); - return classToId != getClassToIdMap().end() ? classToId->second : 0; -} - -MathObjectClass::ClassToIdMap &MathObjectClass::getClassToIdMap() { - static ClassToIdMap map; - return map; -} - -MathObjectClass::ChildToParentMap &MathObjectClass::getChildToParentMap() { - static ChildToParentMap map; - return map; -} - -MathObjectClass::ParentToChildrenMap &MathObjectClass::getParentToChildrenMap() { - static ParentToChildrenMap map; - return map; -} - -MathObjectClass::ParentToChildrenMap &MathObjectClass::getParentToRecursiveChildrenMap() { - static ParentToChildrenMap map; - return map; -} - -} diff --git a/src/fintamath/core/MathObjectIdStorage.cpp b/src/fintamath/core/MathObjectIdStorage.cpp new file mode 100644 index 000000000..39a3ccc68 --- /dev/null +++ b/src/fintamath/core/MathObjectIdStorage.cpp @@ -0,0 +1,19 @@ +#include "fintamath/core/MathObjectIdStorage.hpp" + +namespace fintamath { + +size_t MathObjectIdStorage::get(const MathObjectClass objClass) noexcept { + auto iter = getMap().find(objClass); + return iter != getMap().end() ? iter->second : 0; +} + +void MathObjectIdStorage::add(const MathObjectClass objClass) noexcept { + getMap().insert_or_assign(objClass, maxId++); +} + +MathObjectIdStorage::MathObjectClassToIdMap &MathObjectIdStorage::getMap() noexcept { + static MathObjectIdStorage::MathObjectClassToIdMap map; + return map; +} + +} diff --git a/src/fintamath/expressions/ExpressionComparator.cpp b/src/fintamath/expressions/ExpressionComparator.cpp index 33eaf5f16..eb8fff716 100644 --- a/src/fintamath/expressions/ExpressionComparator.cpp +++ b/src/fintamath/expressions/ExpressionComparator.cpp @@ -309,7 +309,7 @@ Ordering compareExpressionAndNonExpression(const ExpressionPtr &lhs, const Argum Ordering compareFunctions(const FunctionPtr &lhs, const FunctionPtr &rhs) { if (lhs->getClass() != rhs->getClass()) { - return rhs->getClass() <=> lhs->getClass(); + return MathObjectIdStorage::get(rhs->getClass()) <=> MathObjectIdStorage::get(lhs->getClass()); } return rhs->toString() <=> lhs->toString(); diff --git a/src/fintamath/expressions/FunctionExpression.hpp b/src/fintamath/expressions/FunctionExpression.hpp index ea7c486a0..661b41a3b 100644 --- a/src/fintamath/expressions/FunctionExpression.hpp +++ b/src/fintamath/expressions/FunctionExpression.hpp @@ -10,8 +10,8 @@ namespace fintamath { -class FunctionExpression final : public IExpressionCRTP { - FINTAMATH_CLASS_BODY(FunctionExpression) +class FunctionExpression : public IExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(FunctionExpression, IExpression) public: explicit FunctionExpression(const IFunction &inFunc, ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/binary/CompExpr.hpp b/src/fintamath/expressions/binary/CompExpr.hpp index 225bfc9d7..bfabcf182 100644 --- a/src/fintamath/expressions/binary/CompExpr.hpp +++ b/src/fintamath/expressions/binary/CompExpr.hpp @@ -12,8 +12,8 @@ namespace fintamath { class IOperator; -class CompExpr final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(CompExpr) +class CompExpr : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(CompExpr, IBinaryExpression) public: CompExpr(const IOperator &inOper, ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/DerivativeExpr.hpp b/src/fintamath/expressions/binary/DerivativeExpr.hpp index 89c5e6568..d3a5b0982 100644 --- a/src/fintamath/expressions/binary/DerivativeExpr.hpp +++ b/src/fintamath/expressions/binary/DerivativeExpr.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class DerivativeExpr final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(DerivativeExpr) +class DerivativeExpr : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(DerivativeExpr, IBinaryExpression) public: explicit DerivativeExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/DivExpr.hpp b/src/fintamath/expressions/binary/DivExpr.hpp index 34ff07184..4d15ae461 100644 --- a/src/fintamath/expressions/binary/DivExpr.hpp +++ b/src/fintamath/expressions/binary/DivExpr.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class DivExpr final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(DivExpr) +class DivExpr : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(DivExpr, IBinaryExpression) public: explicit DivExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/IntegralExpr.hpp b/src/fintamath/expressions/binary/IntegralExpr.hpp index 0682f4553..7b6b18222 100644 --- a/src/fintamath/expressions/binary/IntegralExpr.hpp +++ b/src/fintamath/expressions/binary/IntegralExpr.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class IntegralExpr final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(IntegralExpr) +class IntegralExpr : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(IntegralExpr, IBinaryExpression) public: explicit IntegralExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/LogExpr.hpp b/src/fintamath/expressions/binary/LogExpr.hpp index 57bc9b178..162fd791c 100644 --- a/src/fintamath/expressions/binary/LogExpr.hpp +++ b/src/fintamath/expressions/binary/LogExpr.hpp @@ -11,8 +11,8 @@ namespace fintamath { -class LogExpr final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(LogExpr) +class LogExpr : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(LogExpr, IBinaryExpression) public: explicit LogExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/PowExpr.hpp b/src/fintamath/expressions/binary/PowExpr.hpp index 7345201fa..312f77d00 100644 --- a/src/fintamath/expressions/binary/PowExpr.hpp +++ b/src/fintamath/expressions/binary/PowExpr.hpp @@ -12,8 +12,8 @@ namespace fintamath { -class PowExpr final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(PowExpr) +class PowExpr : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(PowExpr, IBinaryExpression) public: explicit PowExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/polynomial/AddExpr.hpp b/src/fintamath/expressions/polynomial/AddExpr.hpp index 5328b32f0..27d7697a7 100644 --- a/src/fintamath/expressions/polynomial/AddExpr.hpp +++ b/src/fintamath/expressions/polynomial/AddExpr.hpp @@ -14,8 +14,8 @@ namespace fintamath { -class AddExpr final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(AddExpr) +class AddExpr : public IPolynomExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(AddExpr, IPolynomExpression) public: explicit AddExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/AndExpr.hpp b/src/fintamath/expressions/polynomial/AndExpr.hpp index 27fcab081..d258e8dd8 100644 --- a/src/fintamath/expressions/polynomial/AndExpr.hpp +++ b/src/fintamath/expressions/polynomial/AndExpr.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class AndExpr final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(AndExpr) +class AndExpr : public IPolynomExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(AndExpr, IPolynomExpression) public: explicit AndExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/MinMaxExpr.hpp b/src/fintamath/expressions/polynomial/MinMaxExpr.hpp index 983b14a65..500c5d6bd 100644 --- a/src/fintamath/expressions/polynomial/MinMaxExpr.hpp +++ b/src/fintamath/expressions/polynomial/MinMaxExpr.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class MinMaxExpr final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(MinMaxExpr) +class MinMaxExpr : public IPolynomExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(MinMaxExpr, IPolynomExpression) public: explicit MinMaxExpr(const IFunction &inFunc, ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/MulExpr.hpp b/src/fintamath/expressions/polynomial/MulExpr.hpp index 01628d9f3..91cff44cc 100644 --- a/src/fintamath/expressions/polynomial/MulExpr.hpp +++ b/src/fintamath/expressions/polynomial/MulExpr.hpp @@ -9,8 +9,8 @@ #include "fintamath/functions/IFunction.hpp" namespace fintamath { -class MulExpr final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(MulExpr) +class MulExpr : public IPolynomExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(MulExpr, IPolynomExpression) public: explicit MulExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/OrExpr.hpp b/src/fintamath/expressions/polynomial/OrExpr.hpp index e1563636e..195e72157 100644 --- a/src/fintamath/expressions/polynomial/OrExpr.hpp +++ b/src/fintamath/expressions/polynomial/OrExpr.hpp @@ -9,8 +9,8 @@ namespace fintamath { -class OrExpr final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(OrExpr) +class OrExpr : public IPolynomExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(OrExpr, IPolynomExpression) public: explicit OrExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/unary/AbsExpr.hpp b/src/fintamath/expressions/unary/AbsExpr.hpp index ec5cf037e..0fabbd63f 100644 --- a/src/fintamath/expressions/unary/AbsExpr.hpp +++ b/src/fintamath/expressions/unary/AbsExpr.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class AbsExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(AbsExpr) +class AbsExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(AbsExpr, IUnaryExpression) public: explicit AbsExpr(ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/FloorCeilExpr.hpp b/src/fintamath/expressions/unary/FloorCeilExpr.hpp index e6ae04015..2f2d4fc11 100644 --- a/src/fintamath/expressions/unary/FloorCeilExpr.hpp +++ b/src/fintamath/expressions/unary/FloorCeilExpr.hpp @@ -11,8 +11,8 @@ namespace fintamath { class Rational; -class FloorCeilExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(FloorCeilExpr) +class FloorCeilExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(FloorCeilExpr, IUnaryExpression) public: explicit FloorCeilExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/HyperbExpr.hpp b/src/fintamath/expressions/unary/HyperbExpr.hpp index 3a5e5543b..a1915aba1 100644 --- a/src/fintamath/expressions/unary/HyperbExpr.hpp +++ b/src/fintamath/expressions/unary/HyperbExpr.hpp @@ -9,8 +9,8 @@ namespace fintamath { -class HyperbExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(HyperbExpr) +class HyperbExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(HyperbExpr, IUnaryExpression) public: explicit HyperbExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/InvHyperbExpr.hpp b/src/fintamath/expressions/unary/InvHyperbExpr.hpp index 6b05440ce..8e3d0bc06 100644 --- a/src/fintamath/expressions/unary/InvHyperbExpr.hpp +++ b/src/fintamath/expressions/unary/InvHyperbExpr.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class InvHyperbExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(InvHyperbExpr) +class InvHyperbExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(InvHyperbExpr, IUnaryExpression) public: explicit InvHyperbExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/InvTrigExpr.hpp b/src/fintamath/expressions/unary/InvTrigExpr.hpp index 53a187686..b87139582 100644 --- a/src/fintamath/expressions/unary/InvTrigExpr.hpp +++ b/src/fintamath/expressions/unary/InvTrigExpr.hpp @@ -9,8 +9,8 @@ namespace fintamath { class Rational; -class InvTrigExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(InvTrigExpr) +class InvTrigExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(InvTrigExpr, IUnaryExpression) public: explicit InvTrigExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/NotExpr.hpp b/src/fintamath/expressions/unary/NotExpr.hpp index 1bbf58260..1cd9623e2 100644 --- a/src/fintamath/expressions/unary/NotExpr.hpp +++ b/src/fintamath/expressions/unary/NotExpr.hpp @@ -9,8 +9,8 @@ namespace fintamath { -class NotExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(NotExpr) +class NotExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(NotExpr, IUnaryExpression) public: explicit NotExpr(ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/SignExpr.hpp b/src/fintamath/expressions/unary/SignExpr.hpp index 839f1eea1..ec7086c31 100644 --- a/src/fintamath/expressions/unary/SignExpr.hpp +++ b/src/fintamath/expressions/unary/SignExpr.hpp @@ -7,8 +7,8 @@ namespace fintamath { -class SignExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(SignExpr) +class SignExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(SignExpr, IUnaryExpression) public: explicit SignExpr(ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/TrigExpr.hpp b/src/fintamath/expressions/unary/TrigExpr.hpp index aee3ea448..5695a7c41 100644 --- a/src/fintamath/expressions/unary/TrigExpr.hpp +++ b/src/fintamath/expressions/unary/TrigExpr.hpp @@ -12,8 +12,8 @@ namespace fintamath { class Rational; -class TrigExpr final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(TrigExpr) +class TrigExpr : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TrigExpr, IUnaryExpression) public: explicit TrigExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/tests/src/core/IArithmeticTests.cpp b/tests/src/core/IArithmeticTests.cpp index 7f7b948ca..25c9e721f 100644 --- a/tests/src/core/IArithmeticTests.cpp +++ b/tests/src/core/IArithmeticTests.cpp @@ -11,8 +11,8 @@ using namespace fintamath; namespace { -class TestArithmetic final : public IArithmeticCRTP { - FINTAMATH_CLASS_BODY(TestArithmetic) +class TestArithmetic : public IArithmeticCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestArithmetic, IArithmetic) protected: TestArithmetic &add(const TestArithmetic & /* rhs */) override { @@ -206,6 +206,6 @@ TEST(IArithmeticTests, negateTest) { } TEST(IArithmeticTests, getClassTest) { - EXPECT_EQ(IArithmetic::getClassStatic(), MathObjectClass("IArithmetic")); - EXPECT_EQ(IArithmetic::getClassStatic().getParent(), IMathObject::getClassStatic()); + EXPECT_EQ(IArithmetic::getClassStatic()->getName(), "IArithmetic"); + EXPECT_EQ(IArithmetic::getClassStatic()->getParent(), IMathObject::getClassStatic()); } diff --git a/tests/src/core/IComparableTests.cpp b/tests/src/core/IComparableTests.cpp index c9290aa6f..3d1808ff8 100644 --- a/tests/src/core/IComparableTests.cpp +++ b/tests/src/core/IComparableTests.cpp @@ -10,8 +10,8 @@ using namespace fintamath; namespace { -class TestComparable final : public IComparableCRTP { - FINTAMATH_CLASS_BODY(TestComparable) +class TestComparable : public IComparableCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestComparable, IComparable) protected: std::strong_ordering compare(const TestComparable & /* rhs */) const override { @@ -151,6 +151,6 @@ TEST(IComparableTests, moreEqualsTest) { } TEST(IComparableTests, getClassTest) { - EXPECT_EQ(IComparable::getClassStatic(), MathObjectClass("IComparable")); - EXPECT_EQ(IComparable::getClassStatic().getParent(), IArithmetic::getClassStatic()); + EXPECT_EQ(IComparable::getClassStatic()->getName(), "IComparable"); + EXPECT_EQ(IComparable::getClassStatic()->getParent(), IArithmetic::getClassStatic()); } diff --git a/tests/src/core/IMathObjectTests.cpp b/tests/src/core/IMathObjectTests.cpp index 35d24f007..afdb5c781 100644 --- a/tests/src/core/IMathObjectTests.cpp +++ b/tests/src/core/IMathObjectTests.cpp @@ -11,8 +11,8 @@ using namespace fintamath; namespace { -class TestMathObject final : public IMathObjectCRTP { - FINTAMATH_CLASS_BODY(TestMathObject) +class TestMathObject : public IMathObjectCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestMathObject, IMathObject) }; [[maybe_unused]] const auto config = [] { @@ -110,9 +110,9 @@ TEST(IMathObjectTests, outputTest) { } TEST(IMathObjectTests, getClassTest) { - EXPECT_EQ(IMathObject::getClassStatic(), MathObjectClass("IMathObject")); - EXPECT_FALSE(IMathObject::getClassStatic().getParent()); + EXPECT_EQ(IMathObject::getClassStatic()->getName(), "IMathObject"); + EXPECT_FALSE(IMathObject::getClassStatic()->getParent()); - EXPECT_EQ(TestMathObject().getClass(), MathObjectClass("TestMathObject")); - EXPECT_EQ(TestMathObject().getClass().getParent(), IMathObject::getClassStatic()); + EXPECT_EQ(TestMathObject().getClass()->getName(), "TestMathObject"); + EXPECT_EQ(TestMathObject().getClass()->getParent(), IMathObject::getClassStatic()); } diff --git a/tests/src/core/MathObjectClassTests.cpp b/tests/src/core/MathObjectClassTests.cpp index 0aea487f5..3e124c99f 100644 --- a/tests/src/core/MathObjectClassTests.cpp +++ b/tests/src/core/MathObjectClassTests.cpp @@ -1,6 +1,7 @@ #include #include "fintamath/core/MathObjectBody.hpp" +#include "fintamath/core/None.hpp" using namespace fintamath; using namespace detail; @@ -8,37 +9,37 @@ using namespace detail; namespace { class ISuperParentTest { - FINTAMATH_PARENT_CLASS_BODY(ISuperParentTest) + FINTAMATH_PARENT_CLASS_BODY(ISuperParentTest, None) }; FINTAMATH_PARENT_CLASS_IMPLEMENTATION(ISuperParentTest) class IParentTest1 : public ISuperParentTest { - FINTAMATH_PARENT_CLASS_BODY(IParentTest1) + FINTAMATH_PARENT_CLASS_BODY(IParentTest1, ISuperParentTest) }; FINTAMATH_PARENT_CLASS_IMPLEMENTATION(IParentTest1) class IParentTest2 : public ISuperParentTest { - FINTAMATH_PARENT_CLASS_BODY(IParentTest2) + FINTAMATH_PARENT_CLASS_BODY(IParentTest2, ISuperParentTest) }; FINTAMATH_PARENT_CLASS_IMPLEMENTATION(IParentTest2) class ChildTest1 : public IParentTest1 { - FINTAMATH_CLASS_BODY(ChildTest1) + FINTAMATH_CLASS_BODY(ChildTest1, IParentTest1) }; class ChildTest2 : public IParentTest1 { - FINTAMATH_CLASS_BODY(ChildTest2) + FINTAMATH_CLASS_BODY(ChildTest2, IParentTest1) }; class ChildTest3 : public IParentTest2 { - FINTAMATH_CLASS_BODY(ChildTest3) + FINTAMATH_CLASS_BODY(ChildTest3, IParentTest2) }; class OtherChildTest : public IParentTest2 { - FINTAMATH_CLASS_BODY(OtherChildTest) + FINTAMATH_CLASS_BODY(OtherChildTest, IParentTest2) }; [[maybe_unused]] const auto config = [] { @@ -54,79 +55,38 @@ class OtherChildTest : public IParentTest2 { TEST(MathObjectClassTests, constructorTest) { { - constexpr MathObjectClass t("Test"); - EXPECT_EQ(t.getName(), "Test"); + constexpr MathObjectClassImpl t1("Test"); + EXPECT_EQ(t1.getName(), "Test"); + EXPECT_FALSE(t1.getParent()); + + constexpr MathObjectClassImpl t2("Test", ISuperParentTest::getClassStatic()); + EXPECT_EQ(t2.getName(), "Test"); + EXPECT_EQ(t2.getParent(), ISuperParentTest::getClassStatic()); } { - MathObjectClass t("Test"); - EXPECT_EQ(t.getName(), "Test"); - } -} + MathObjectClassImpl t1("Test"); + EXPECT_EQ(t1.getName(), "Test"); + EXPECT_FALSE(t1.getParent()); -TEST(MathObjectClassTests, equalsTest) { - EXPECT_TRUE(ChildTest1::getClassStatic() == ChildTest1::getClassStatic()); - EXPECT_FALSE(ChildTest1::getClassStatic() == ChildTest2::getClassStatic()); - EXPECT_FALSE(ChildTest2::getClassStatic() == ChildTest1::getClassStatic()); -} - -TEST(MathObjectClassTests, compareTest) { - EXPECT_EQ(ChildTest1::getClassStatic() <=> ChildTest1::getClassStatic(), std::strong_ordering::equal); - EXPECT_EQ(ChildTest1::getClassStatic() <=> ChildTest2::getClassStatic(), std::strong_ordering::less); - EXPECT_EQ(ChildTest2::getClassStatic() <=> ChildTest1::getClassStatic(), std::strong_ordering::greater); + MathObjectClassImpl t2("Test", ISuperParentTest::getClassStatic()); + EXPECT_EQ(t2.getName(), "Test"); + EXPECT_EQ(t2.getParent(), ISuperParentTest::getClassStatic()); + } } TEST(MathObjectClassTests, getNameTest) { - EXPECT_EQ(ChildTest1::getClassStatic().getName(), "ChildTest1"); + EXPECT_EQ(ChildTest1::getClassStatic()->getName(), "ChildTest1"); } TEST(MathObjectClassTests, getParentTest) { - EXPECT_FALSE(MathObjectClass("Test").getParent()); - - EXPECT_FALSE(ISuperParentTest::getClassStatic().getParent()); - - EXPECT_EQ(IParentTest1::getClassStatic().getParent(), ISuperParentTest::getClassStatic()); - EXPECT_EQ(IParentTest2::getClassStatic().getParent(), ISuperParentTest::getClassStatic()); - - EXPECT_EQ(ChildTest1::getClassStatic().getParent(), IParentTest1::getClassStatic()); - EXPECT_EQ(ChildTest2::getClassStatic().getParent(), IParentTest1::getClassStatic()); - EXPECT_EQ(ChildTest3::getClassStatic().getParent(), IParentTest2::getClassStatic()); -} - -TEST(MathObjectClassTests, getChildrenTest) { - EXPECT_EQ(MathObjectClass("Test").getChildren().size(), 0); + EXPECT_FALSE(MathObjectClassImpl("Test").getParent()); - EXPECT_EQ(ISuperParentTest::getClassStatic().getChildren().size(), 2); + EXPECT_FALSE(ISuperParentTest::getClassStatic()->getParent()); - EXPECT_EQ(IParentTest1::getClassStatic().getChildren().size(), 2); - EXPECT_EQ(IParentTest2::getClassStatic().getChildren().size(), 1); - - EXPECT_EQ(ChildTest1::getClassStatic().getChildren().size(), 0); - EXPECT_EQ(ChildTest2::getClassStatic().getChildren().size(), 0); - EXPECT_EQ(ChildTest3::getClassStatic().getChildren().size(), 0); -} - -TEST(MathObjectClassTests, getChildrenRecursiveTest) { - EXPECT_EQ(MathObjectClass("Test").getChildren(true).size(), 0); - - EXPECT_EQ(ISuperParentTest::getClassStatic().getChildren(true).size(), 5); - - EXPECT_EQ(IParentTest1::getClassStatic().getChildren(true).size(), 2); - EXPECT_EQ(IParentTest2::getClassStatic().getChildren(true).size(), 1); - - EXPECT_EQ(ChildTest1::getClassStatic().getChildren(true).size(), 0); - EXPECT_EQ(ChildTest2::getClassStatic().getChildren(true).size(), 0); - EXPECT_EQ(ChildTest3::getClassStatic().getChildren(true).size(), 0); -} - -TEST(MathObjectClassTests, bindTypesTest) { - EXPECT_FALSE(OtherChildTest::getClassStatic().getParent()); - - MathObjectClass::bindTypes(); - - EXPECT_EQ(OtherChildTest::getClassStatic().getParent(), IParentTest2::getClassStatic()); -} + EXPECT_EQ(IParentTest1::getClassStatic()->getParent(), ISuperParentTest::getClassStatic()); + EXPECT_EQ(IParentTest2::getClassStatic()->getParent(), ISuperParentTest::getClassStatic()); -TEST(MathObjectClassTests, hashTest) { - EXPECT_EQ(std::hash{}(MathObjectClass("Test")), - std::hash{}("Test")); + EXPECT_EQ(ChildTest1::getClassStatic()->getParent(), IParentTest1::getClassStatic()); + EXPECT_EQ(ChildTest2::getClassStatic()->getParent(), IParentTest1::getClassStatic()); + EXPECT_EQ(ChildTest3::getClassStatic()->getParent(), IParentTest2::getClassStatic()); } diff --git a/tests/src/core/MathObjectUtilsTests.cpp b/tests/src/core/MathObjectUtilsTests.cpp index bc4b6223f..de79b21ed 100644 --- a/tests/src/core/MathObjectUtilsTests.cpp +++ b/tests/src/core/MathObjectUtilsTests.cpp @@ -37,10 +37,10 @@ TEST(MathObjectUtilsTests, isTest) { TEST(MathObjectUtilsTests, castTest) { EXPECT_NO_THROW(cast(i)); - EXPECT_THROW(cast(cast(c)), std::bad_cast); + EXPECT_DEBUG_DEATH(cast(cast(c)), ""); EXPECT_NO_THROW(cast(Integer(1))); - EXPECT_THROW(cast(cast(E())), std::bad_cast); + EXPECT_DEBUG_DEATH(cast(cast(E())), ""); EXPECT_TRUE(cast(i.clone().get())); EXPECT_FALSE(cast(E().clone().get())); diff --git a/tests/src/core/NoneTests.cpp b/tests/src/core/NoneTests.cpp new file mode 100644 index 000000000..f3756267b --- /dev/null +++ b/tests/src/core/NoneTests.cpp @@ -0,0 +1,9 @@ +#include + +#include "fintamath/core/None.hpp" + +using namespace fintamath; + +TEST(NoneTests, getClassTest) { + EXPECT_FALSE(None::getClassStatic()); +} diff --git a/tests/src/expressions/ExpressionTests.cpp b/tests/src/expressions/ExpressionTests.cpp index 0fba33d51..e3a083b0f 100644 --- a/tests/src/expressions/ExpressionTests.cpp +++ b/tests/src/expressions/ExpressionTests.cpp @@ -98,6 +98,6 @@ TEST(ExpressionTests, equalsTest) { } TEST(ExpressionTests, getClassTest) { - EXPECT_EQ(Expression().getClass(), MathObjectClass("Expression")); - EXPECT_EQ(Expression().getClassStatic().getParent(), IExpression::getClassStatic()); + EXPECT_EQ(Expression().getClass()->getName(), "Expression"); + EXPECT_EQ(Expression().getClassStatic()->getParent(), IExpression::getClassStatic()); } diff --git a/tests/src/expressions/FunctionExpressionTests.cpp b/tests/src/expressions/FunctionExpressionTests.cpp index b64ced571..0165f025c 100644 --- a/tests/src/expressions/FunctionExpressionTests.cpp +++ b/tests/src/expressions/FunctionExpressionTests.cpp @@ -9,8 +9,8 @@ using namespace detail; namespace { -class TestUnaryFunction final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(TestUnaryFunction) +class TestUnaryFunction : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestUnaryFunction, IFunction) public: std::string toString() const override { @@ -23,8 +23,8 @@ class TestUnaryFunction final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(TestBinaryFunction) +class TestBinaryFunction : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestBinaryFunction, IFunction) public: std::string toString() const override { @@ -37,8 +37,8 @@ class TestBinaryFunction final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(TestBinaryOperator) +class TestBinaryOperator : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestBinaryOperator, IOperator) public: std::string toString() const override { @@ -55,8 +55,8 @@ class TestBinaryOperator final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(TestUnaryPrefixOperator) +class TestUnaryPrefixOperator : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestUnaryPrefixOperator, IOperator) public: std::string toString() const override { @@ -73,8 +73,8 @@ class TestUnaryPrefixOperator final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(TestUnaryPostfixOperator) +class TestUnaryPostfixOperator : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestUnaryPostfixOperator, IOperator) public: std::string toString() const override { @@ -127,6 +127,6 @@ TEST(FunctionExpressionTests, stringConstructorTest) { TEST(FunctionExpressionTests, getClassTest) { auto expr = makeExpr(TestBinaryOperator(), Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("FunctionExpression")); - EXPECT_EQ(expr->getClass().getParent(), IExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "FunctionExpression"); + EXPECT_EQ(expr->getClass()->getParent(), IExpression::getClassStatic()); } diff --git a/tests/src/expressions/IExpressionTests.cpp b/tests/src/expressions/IExpressionTests.cpp index 66651c2cf..68f564e7e 100644 --- a/tests/src/expressions/IExpressionTests.cpp +++ b/tests/src/expressions/IExpressionTests.cpp @@ -12,8 +12,8 @@ using namespace fintamath; namespace { -class TestExpression final : public IExpressionCRTP { - FINTAMATH_CLASS_BODY(TestExpression) +class TestExpression : public IExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestExpression, IExpression) public: const std::shared_ptr &getFunction() const override { @@ -103,6 +103,6 @@ TEST(IExpressionTests, toMinimalObjectTest) { } TEST(IExpressionTests, getClassTest) { - EXPECT_EQ(IExpression::getClassStatic(), MathObjectClass("IExpression")); - EXPECT_EQ(IExpression::getClassStatic().getParent(), IMathObject::getClassStatic()); + EXPECT_EQ(IExpression::getClassStatic()->getName(), "IExpression"); + EXPECT_EQ(IExpression::getClassStatic()->getParent(), IMathObject::getClassStatic()); } diff --git a/tests/src/expressions/binary/CompExprTests.cpp b/tests/src/expressions/binary/CompExprTests.cpp index 0ef05a2e7..7d30a1d1a 100644 --- a/tests/src/expressions/binary/CompExprTests.cpp +++ b/tests/src/expressions/binary/CompExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(CompExprTests, getClassTest) { const auto expr = eqvExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("CompExpr")); - EXPECT_EQ(expr->getClass().getParent(), IBinaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "CompExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IBinaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/binary/DerivativeExprTests.cpp b/tests/src/expressions/binary/DerivativeExprTests.cpp index d5594f7dc..5dcc01a6e 100644 --- a/tests/src/expressions/binary/DerivativeExprTests.cpp +++ b/tests/src/expressions/binary/DerivativeExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(DerivativeExprTests, getClassTest) { const auto expr = derivativeExpr(Integer(0), Variable("x")); - EXPECT_EQ(expr->getClass(), MathObjectClass("DerivativeExpr")); - EXPECT_EQ(expr->getClass().getParent(), IBinaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "DerivativeExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IBinaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/binary/DivExprTests.cpp b/tests/src/expressions/binary/DivExprTests.cpp index 17dd94dba..f907a25c9 100644 --- a/tests/src/expressions/binary/DivExprTests.cpp +++ b/tests/src/expressions/binary/DivExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(DivExprTests, getClassTest) { const auto expr = divExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("DivExpr")); - EXPECT_EQ(expr->getClass().getParent(), IBinaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "DivExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IBinaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/binary/IntegralExprTests.cpp b/tests/src/expressions/binary/IntegralExprTests.cpp index e2828cd87..e6e9df95a 100644 --- a/tests/src/expressions/binary/IntegralExprTests.cpp +++ b/tests/src/expressions/binary/IntegralExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(IntegralExprTests, getClassTest) { const auto expr = integralExpr(Integer(0), Variable("x")); - EXPECT_EQ(expr->getClass(), MathObjectClass("IntegralExpr")); - EXPECT_EQ(expr->getClass().getParent(), IBinaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "IntegralExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IBinaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/binary/LogExprTests.cpp b/tests/src/expressions/binary/LogExprTests.cpp index fb641475a..3a077c67b 100644 --- a/tests/src/expressions/binary/LogExprTests.cpp +++ b/tests/src/expressions/binary/LogExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(LogExprTests, getClassTest) { const auto expr = logExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("LogExpr")); - EXPECT_EQ(expr->getClass().getParent(), IBinaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "LogExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IBinaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/binary/PowExprTests.cpp b/tests/src/expressions/binary/PowExprTests.cpp index 59b1ed296..268a6f9fe 100644 --- a/tests/src/expressions/binary/PowExprTests.cpp +++ b/tests/src/expressions/binary/PowExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(PowExprTests, getClassTest) { const auto expr = powExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("PowExpr")); - EXPECT_EQ(expr->getClass().getParent(), IBinaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "PowExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IBinaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/interfaces/IBinaryExpressionTests.cpp b/tests/src/expressions/interfaces/IBinaryExpressionTests.cpp index 074676a28..dbf9ed197 100644 --- a/tests/src/expressions/interfaces/IBinaryExpressionTests.cpp +++ b/tests/src/expressions/interfaces/IBinaryExpressionTests.cpp @@ -10,8 +10,8 @@ const AddOper f; namespace { -class TestBinaryExpression final : public IBinaryExpressionCRTP { - FINTAMATH_CLASS_BODY(TestBinaryExpression) +class TestBinaryExpression : public IBinaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestBinaryExpression, IBinaryExpression) public: explicit TestBinaryExpression(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild) @@ -71,6 +71,6 @@ TEST(IBinaryExpressionTests, toMinimalObjectTest) { } TEST(IBinaryExpressionTests, getClassTest) { - EXPECT_EQ(IBinaryExpression::getClassStatic(), MathObjectClass("IBinaryExpression")); - EXPECT_EQ(IBinaryExpression::getClassStatic().getParent(), IExpression::getClassStatic()); + EXPECT_EQ(IBinaryExpression::getClassStatic()->getName(), "IBinaryExpression"); + EXPECT_EQ(IBinaryExpression::getClassStatic()->getParent(), IExpression::getClassStatic()); } diff --git a/tests/src/expressions/interfaces/IPolynomExpressionTests.cpp b/tests/src/expressions/interfaces/IPolynomExpressionTests.cpp index a34463ea5..b4e6472b8 100644 --- a/tests/src/expressions/interfaces/IPolynomExpressionTests.cpp +++ b/tests/src/expressions/interfaces/IPolynomExpressionTests.cpp @@ -12,8 +12,8 @@ const Mul f; namespace { -class TestPolynomExpression final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(TestPolynomExpression) +class TestPolynomExpression : public IPolynomExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestPolynomExpression, IPolynomExpression) public: explicit TestPolynomExpression(ArgumentPtrVector args) : IPolynomExpressionCRTP(f, std::move(args)) { @@ -79,6 +79,6 @@ TEST(IPolynomExpressionTests, toMinimalObjectTest) { } TEST(IPolynomExpressionTests, getClassTest) { - EXPECT_EQ(IPolynomExpression::getClassStatic(), MathObjectClass("IPolynomExpression")); - EXPECT_EQ(IPolynomExpression::getClassStatic().getParent(), IExpression::getClassStatic()); + EXPECT_EQ(IPolynomExpression::getClassStatic()->getName(), "IPolynomExpression"); + EXPECT_EQ(IPolynomExpression::getClassStatic()->getParent(), IExpression::getClassStatic()); } diff --git a/tests/src/expressions/interfaces/IUnaryExpressionTests.cpp b/tests/src/expressions/interfaces/IUnaryExpressionTests.cpp index cafa0c6b3..184e21bab 100644 --- a/tests/src/expressions/interfaces/IUnaryExpressionTests.cpp +++ b/tests/src/expressions/interfaces/IUnaryExpressionTests.cpp @@ -10,8 +10,8 @@ const Factorial f; namespace { -class TestUnaryExpression final : public IUnaryExpressionCRTP { - FINTAMATH_CLASS_BODY(TestUnaryExpression) +class TestUnaryExpression : public IUnaryExpressionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestUnaryExpression, IUnaryExpression) public: explicit TestUnaryExpression(ArgumentPtr inRhsChild) @@ -70,6 +70,6 @@ TEST(IUnaryExpressionTests, toMinimalObjectTest) { } TEST(IUnaryExpressionTests, getClassTest) { - EXPECT_EQ(IUnaryExpression::getClassStatic(), MathObjectClass("IUnaryExpression")); - EXPECT_EQ(IUnaryExpression::getClassStatic().getParent(), IExpression::getClassStatic()); + EXPECT_EQ(IUnaryExpression::getClassStatic()->getName(), "IUnaryExpression"); + EXPECT_EQ(IUnaryExpression::getClassStatic()->getParent(), IExpression::getClassStatic()); } diff --git a/tests/src/expressions/polynomial/AddExprTests.cpp b/tests/src/expressions/polynomial/AddExprTests.cpp index 5d30d03a0..5b7182cea 100644 --- a/tests/src/expressions/polynomial/AddExprTests.cpp +++ b/tests/src/expressions/polynomial/AddExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(AddExprTests, getClassTest) { const auto expr = addExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("AddExpr")); - EXPECT_EQ(expr->getClass().getParent(), IPolynomExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "AddExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IPolynomExpression::getClassStatic()); } diff --git a/tests/src/expressions/polynomial/AndExprTests.cpp b/tests/src/expressions/polynomial/AndExprTests.cpp index a41b50205..a2d793f1a 100644 --- a/tests/src/expressions/polynomial/AndExprTests.cpp +++ b/tests/src/expressions/polynomial/AndExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(AndExprTests, getClassTest) { const auto expr = andExpr(Boolean(), Boolean()); - EXPECT_EQ(expr->getClass(), MathObjectClass("AndExpr")); - EXPECT_EQ(expr->getClass().getParent(), IPolynomExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "AndExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IPolynomExpression::getClassStatic()); } diff --git a/tests/src/expressions/polynomial/MinMaxExprTests.cpp b/tests/src/expressions/polynomial/MinMaxExprTests.cpp index 033722309..24391ef30 100644 --- a/tests/src/expressions/polynomial/MinMaxExprTests.cpp +++ b/tests/src/expressions/polynomial/MinMaxExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(MinMaxExprTests, getClassTest) { const auto expr = minExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("MinMaxExpr")); - EXPECT_EQ(expr->getClass().getParent(), IPolynomExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "MinMaxExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IPolynomExpression::getClassStatic()); } diff --git a/tests/src/expressions/polynomial/MulExprTests.cpp b/tests/src/expressions/polynomial/MulExprTests.cpp index 6f97e33d1..c2fe818db 100644 --- a/tests/src/expressions/polynomial/MulExprTests.cpp +++ b/tests/src/expressions/polynomial/MulExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(MulExprTests, getClassTest) { const auto expr = mulExpr(Integer(0), Integer(0)); - EXPECT_EQ(expr->getClass(), MathObjectClass("MulExpr")); - EXPECT_EQ(expr->getClass().getParent(), IPolynomExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "MulExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IPolynomExpression::getClassStatic()); } diff --git a/tests/src/expressions/polynomial/OrExprTests.cpp b/tests/src/expressions/polynomial/OrExprTests.cpp index 57fba1558..ac1a527b8 100644 --- a/tests/src/expressions/polynomial/OrExprTests.cpp +++ b/tests/src/expressions/polynomial/OrExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(OrExprTests, getClassTest) { const auto expr = orExpr(Boolean(), Boolean()); - EXPECT_EQ(expr->getClass(), MathObjectClass("OrExpr")); - EXPECT_EQ(expr->getClass().getParent(), IPolynomExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "OrExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IPolynomExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/AbsExprTests.cpp b/tests/src/expressions/unary/AbsExprTests.cpp index dd46d577c..9d5b75f94 100644 --- a/tests/src/expressions/unary/AbsExprTests.cpp +++ b/tests/src/expressions/unary/AbsExprTests.cpp @@ -9,6 +9,6 @@ using namespace fintamath; TEST(AbsExprTests, getClassTest) { const auto expr = absExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("AbsExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "AbsExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/FloorCeilExprTests.cpp b/tests/src/expressions/unary/FloorCeilExprTests.cpp index 39753ca30..4957a3770 100644 --- a/tests/src/expressions/unary/FloorCeilExprTests.cpp +++ b/tests/src/expressions/unary/FloorCeilExprTests.cpp @@ -9,6 +9,6 @@ using namespace fintamath; TEST(FloorCeilExprTests, getClassTest) { const auto expr = floorExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("FloorCeilExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "FloorCeilExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/HyperbExprTests.cpp b/tests/src/expressions/unary/HyperbExprTests.cpp index f0c19a10f..e83a568a2 100644 --- a/tests/src/expressions/unary/HyperbExprTests.cpp +++ b/tests/src/expressions/unary/HyperbExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(HyperbExprTests, getClassTest) { const auto expr = sinhExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("HyperbExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "HyperbExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/InvHyperbExprTests.cpp b/tests/src/expressions/unary/InvHyperbExprTests.cpp index 668a50b62..7950b7d71 100644 --- a/tests/src/expressions/unary/InvHyperbExprTests.cpp +++ b/tests/src/expressions/unary/InvHyperbExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(InvHyperbExprTests, getClassTest) { const auto expr = asinhExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("InvHyperbExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "InvHyperbExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/InvTrigExprTests.cpp b/tests/src/expressions/unary/InvTrigExprTests.cpp index b5513c262..dad1b29d6 100644 --- a/tests/src/expressions/unary/InvTrigExprTests.cpp +++ b/tests/src/expressions/unary/InvTrigExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(InvTrigExprTests, getClassTest) { const auto expr = asinExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("InvTrigExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "InvTrigExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/NotExprTests.cpp b/tests/src/expressions/unary/NotExprTests.cpp index f4ed5cdf9..c41b8bde2 100644 --- a/tests/src/expressions/unary/NotExprTests.cpp +++ b/tests/src/expressions/unary/NotExprTests.cpp @@ -10,6 +10,6 @@ using namespace fintamath; TEST(NotExprTests, getClassTest) { const auto expr = notExpr(Boolean()); - EXPECT_EQ(expr->getClass(), MathObjectClass("NotExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "NotExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/SignExprTests.cpp b/tests/src/expressions/unary/SignExprTests.cpp index 68754079e..60209e15d 100644 --- a/tests/src/expressions/unary/SignExprTests.cpp +++ b/tests/src/expressions/unary/SignExprTests.cpp @@ -9,6 +9,6 @@ using namespace fintamath; TEST(SignExprTests, getClassTest) { const auto expr = signExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("SignExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "SignExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/expressions/unary/TrigExprTests.cpp b/tests/src/expressions/unary/TrigExprTests.cpp index 09bb2734f..d71e9eef6 100644 --- a/tests/src/expressions/unary/TrigExprTests.cpp +++ b/tests/src/expressions/unary/TrigExprTests.cpp @@ -9,6 +9,6 @@ using namespace fintamath; TEST(TrigExprTests, getClassTest) { const auto expr = sinExpr(Integer(0).clone()); - EXPECT_EQ(expr->getClass(), MathObjectClass("TrigExpr")); - EXPECT_EQ(expr->getClass().getParent(), IUnaryExpression::getClassStatic()); + EXPECT_EQ(expr->getClass()->getName(), "TrigExpr"); + EXPECT_EQ(expr->getClass()->getParent(), IUnaryExpression::getClassStatic()); } diff --git a/tests/src/functions/IFunctionTests.cpp b/tests/src/functions/IFunctionTests.cpp index 4639b02a7..b2ea86217 100644 --- a/tests/src/functions/IFunctionTests.cpp +++ b/tests/src/functions/IFunctionTests.cpp @@ -17,8 +17,8 @@ using namespace fintamath; namespace { -class TestFunction final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(TestFunction) +class TestFunction : public IFunctionCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestFunction, IFunction) protected: std::unique_ptr call(const ArgumentRefVector &argVect) const override { @@ -128,6 +128,6 @@ TEST(IFunctionTests, doArgsMatchTest) { } TEST(IFunctionTests, getClassTest) { - EXPECT_EQ(IFunction::getClassStatic(), MathObjectClass("IFunction")); - EXPECT_EQ(IFunction::getClassStatic().getParent(), IMathObject::getClassStatic()); + EXPECT_EQ(IFunction::getClassStatic()->getName(), "IFunction"); + EXPECT_EQ(IFunction::getClassStatic()->getParent(), IMathObject::getClassStatic()); } diff --git a/tests/src/functions/IOperatorTests.cpp b/tests/src/functions/IOperatorTests.cpp index 776c617da..28598abdc 100644 --- a/tests/src/functions/IOperatorTests.cpp +++ b/tests/src/functions/IOperatorTests.cpp @@ -13,8 +13,8 @@ using namespace fintamath; namespace { -class TestOperator final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(TestOperator) +class TestOperator : public IOperatorCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestOperator, IOperator) public: static constexpr Priority getPriorityStatic() { @@ -53,6 +53,6 @@ TEST(IOperatorTests, isAssociativeTest) { } TEST(IOperatorTests, getClassTest) { - EXPECT_EQ(IOperator::getClassStatic(), MathObjectClass("IOperator")); - EXPECT_EQ(IOperator::getClassStatic().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(IOperator::getClassStatic()->getName(), "IOperator"); + EXPECT_EQ(IOperator::getClassStatic()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/AbsTests.cpp b/tests/src/functions/arithmetic/AbsTests.cpp index 989209f6c..b1a6159a4 100644 --- a/tests/src/functions/arithmetic/AbsTests.cpp +++ b/tests/src/functions/arithmetic/AbsTests.cpp @@ -69,6 +69,6 @@ TEST(AbsTests, exprTest) { } TEST(AbsTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Abs")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Abs"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/AddOperTests.cpp b/tests/src/functions/arithmetic/AddOperTests.cpp index 525837d86..da0d2d007 100644 --- a/tests/src/functions/arithmetic/AddOperTests.cpp +++ b/tests/src/functions/arithmetic/AddOperTests.cpp @@ -55,6 +55,6 @@ TEST(AddOperTests, callTest) { } TEST(AddOperTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("AddOper")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "AddOper"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/AddTests.cpp b/tests/src/functions/arithmetic/AddTests.cpp index 3fd400186..7c7c5816e 100644 --- a/tests/src/functions/arithmetic/AddTests.cpp +++ b/tests/src/functions/arithmetic/AddTests.cpp @@ -58,6 +58,6 @@ TEST(AddTests, exprTest) { } TEST(AddTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Add")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Add"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/DivTests.cpp b/tests/src/functions/arithmetic/DivTests.cpp index c3ba19656..1785dfac1 100644 --- a/tests/src/functions/arithmetic/DivTests.cpp +++ b/tests/src/functions/arithmetic/DivTests.cpp @@ -61,6 +61,6 @@ TEST(DivTests, exprTest) { } TEST(DivTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Div")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Div"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/FracMixedTests.cpp b/tests/src/functions/arithmetic/FracMixedTests.cpp index b97969f3e..100a6eadf 100644 --- a/tests/src/functions/arithmetic/FracMixedTests.cpp +++ b/tests/src/functions/arithmetic/FracMixedTests.cpp @@ -53,6 +53,6 @@ TEST(FracMixedTests, callTest) { } TEST(FracMixedTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("FracMixed")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "FracMixed"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/FracTests.cpp b/tests/src/functions/arithmetic/FracTests.cpp index c0d99be83..1b6e63545 100644 --- a/tests/src/functions/arithmetic/FracTests.cpp +++ b/tests/src/functions/arithmetic/FracTests.cpp @@ -46,6 +46,6 @@ TEST(FracTests, callTest) { } TEST(FracTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Frac")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Frac"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/MulOperTests.cpp b/tests/src/functions/arithmetic/MulOperTests.cpp index ec175ff2b..f6bd039fd 100644 --- a/tests/src/functions/arithmetic/MulOperTests.cpp +++ b/tests/src/functions/arithmetic/MulOperTests.cpp @@ -53,6 +53,6 @@ TEST(MulOperTests, callTest) { } TEST(MulOperTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("MulOper")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "MulOper"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/MulTests.cpp b/tests/src/functions/arithmetic/MulTests.cpp index 86b36aac3..976a0f72d 100644 --- a/tests/src/functions/arithmetic/MulTests.cpp +++ b/tests/src/functions/arithmetic/MulTests.cpp @@ -59,6 +59,6 @@ TEST(MulTests, exprTest) { } TEST(MulTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Mul")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Mul"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/NegTests.cpp b/tests/src/functions/arithmetic/NegTests.cpp index 4e9626656..f4f70d82d 100644 --- a/tests/src/functions/arithmetic/NegTests.cpp +++ b/tests/src/functions/arithmetic/NegTests.cpp @@ -55,6 +55,6 @@ TEST(NegTests, exprTest) { } TEST(NegTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Neg")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Neg"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/SignTests.cpp b/tests/src/functions/arithmetic/SignTests.cpp index 488f81fa9..ab4c5d6d7 100644 --- a/tests/src/functions/arithmetic/SignTests.cpp +++ b/tests/src/functions/arithmetic/SignTests.cpp @@ -67,6 +67,6 @@ TEST(SignTests, exprTest) { } TEST(SignTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sign")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sign"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/SubTests.cpp b/tests/src/functions/arithmetic/SubTests.cpp index 98b923f28..600b7a28b 100644 --- a/tests/src/functions/arithmetic/SubTests.cpp +++ b/tests/src/functions/arithmetic/SubTests.cpp @@ -59,6 +59,6 @@ TEST(SubTests, exprTest) { } TEST(SubTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sub")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sub"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/arithmetic/UnaryPlusTests.cpp b/tests/src/functions/arithmetic/UnaryPlusTests.cpp index d7c70bbb5..20f38e888 100644 --- a/tests/src/functions/arithmetic/UnaryPlusTests.cpp +++ b/tests/src/functions/arithmetic/UnaryPlusTests.cpp @@ -52,6 +52,6 @@ TEST(UnaryPlusTests, callTest) { } TEST(UnaryPlusTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("UnaryPlus")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "UnaryPlus"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/calculus/DerivativeTests.cpp b/tests/src/functions/calculus/DerivativeTests.cpp index eb50a9f4b..56e0bcdce 100644 --- a/tests/src/functions/calculus/DerivativeTests.cpp +++ b/tests/src/functions/calculus/DerivativeTests.cpp @@ -14,8 +14,8 @@ const Derivative f; namespace { -class TestComparable final : public IComparableCRTP { - FINTAMATH_CLASS_BODY(TestComparable) +class TestComparable : public IComparableCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestComparable, IComparable) public: std::string toString() const override { @@ -97,6 +97,6 @@ TEST(DerivativeTests, exprTest) { } TEST(DerivativeTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Derivative")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Derivative"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/calculus/IntegralTests.cpp b/tests/src/functions/calculus/IntegralTests.cpp index faf41044a..e34980f3e 100644 --- a/tests/src/functions/calculus/IntegralTests.cpp +++ b/tests/src/functions/calculus/IntegralTests.cpp @@ -53,6 +53,6 @@ TEST(IntegralTests, exprTest) { } TEST(IntegralTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Integral")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Integral"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/calculus/MaxTests.cpp b/tests/src/functions/calculus/MaxTests.cpp index 29021aad4..3830c9c75 100644 --- a/tests/src/functions/calculus/MaxTests.cpp +++ b/tests/src/functions/calculus/MaxTests.cpp @@ -58,6 +58,6 @@ TEST(MaxTests, exprTest) { } TEST(MaxTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Max")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Max"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/calculus/MinTests.cpp b/tests/src/functions/calculus/MinTests.cpp index ece74398b..e978e1d2e 100644 --- a/tests/src/functions/calculus/MinTests.cpp +++ b/tests/src/functions/calculus/MinTests.cpp @@ -58,6 +58,6 @@ TEST(MinTests, exprTest) { } TEST(MinTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Min")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Min"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/comparison/EqvTests.cpp b/tests/src/functions/comparison/EqvTests.cpp index e395c5689..1fa170f84 100644 --- a/tests/src/functions/comparison/EqvTests.cpp +++ b/tests/src/functions/comparison/EqvTests.cpp @@ -65,6 +65,6 @@ TEST(EqvTests, exprTest) { } TEST(EqvTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Eqv")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Eqv"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/comparison/LessEqvTests.cpp b/tests/src/functions/comparison/LessEqvTests.cpp index 167da7eba..b4b4e1612 100644 --- a/tests/src/functions/comparison/LessEqvTests.cpp +++ b/tests/src/functions/comparison/LessEqvTests.cpp @@ -65,6 +65,6 @@ TEST(LessEqvTests, exprTest) { } TEST(LessEqvTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("LessEqv")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "LessEqv"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/comparison/LessTests.cpp b/tests/src/functions/comparison/LessTests.cpp index 284453ee9..4d36a2068 100644 --- a/tests/src/functions/comparison/LessTests.cpp +++ b/tests/src/functions/comparison/LessTests.cpp @@ -65,6 +65,6 @@ TEST(LessTests, exprTest) { } TEST(LessTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Less")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Less"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/comparison/MoreEqvTests.cpp b/tests/src/functions/comparison/MoreEqvTests.cpp index eed084eaf..b8ea36c27 100644 --- a/tests/src/functions/comparison/MoreEqvTests.cpp +++ b/tests/src/functions/comparison/MoreEqvTests.cpp @@ -65,6 +65,6 @@ TEST(MoreEqvTests, exprTest) { } TEST(MoreEqvTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("MoreEqv")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "MoreEqv"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/comparison/MoreTests.cpp b/tests/src/functions/comparison/MoreTests.cpp index 8db533f21..25a64b474 100644 --- a/tests/src/functions/comparison/MoreTests.cpp +++ b/tests/src/functions/comparison/MoreTests.cpp @@ -65,6 +65,6 @@ TEST(MoreTests, exprTest) { } TEST(MoreTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("More")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "More"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/comparison/NeqvTests.cpp b/tests/src/functions/comparison/NeqvTests.cpp index 8658f175b..cb9fac49a 100644 --- a/tests/src/functions/comparison/NeqvTests.cpp +++ b/tests/src/functions/comparison/NeqvTests.cpp @@ -65,6 +65,6 @@ TEST(NeqvTests, exprTest) { } TEST(NeqvTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Neqv")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Neqv"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/AcoshTests.cpp b/tests/src/functions/hyperbolic/AcoshTests.cpp index edd446c64..f1756259d 100644 --- a/tests/src/functions/hyperbolic/AcoshTests.cpp +++ b/tests/src/functions/hyperbolic/AcoshTests.cpp @@ -57,6 +57,6 @@ TEST(AcoshTests, exprTest) { } TEST(AcoshTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Acosh")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Acosh"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/AcothTests.cpp b/tests/src/functions/hyperbolic/AcothTests.cpp index 61670637b..6e0632490 100644 --- a/tests/src/functions/hyperbolic/AcothTests.cpp +++ b/tests/src/functions/hyperbolic/AcothTests.cpp @@ -57,6 +57,6 @@ TEST(AcothTests, exprTest) { } TEST(AcothTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Acoth")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Acoth"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/AcschTests.cpp b/tests/src/functions/hyperbolic/AcschTests.cpp index e7c42eedc..a770081ee 100644 --- a/tests/src/functions/hyperbolic/AcschTests.cpp +++ b/tests/src/functions/hyperbolic/AcschTests.cpp @@ -56,6 +56,6 @@ TEST(AcschTests, exprTest) { } TEST(AcschTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Acsch")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Acsch"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/AsechTests.cpp b/tests/src/functions/hyperbolic/AsechTests.cpp index 86572daac..d74dfa16e 100644 --- a/tests/src/functions/hyperbolic/AsechTests.cpp +++ b/tests/src/functions/hyperbolic/AsechTests.cpp @@ -57,6 +57,6 @@ TEST(AsechTests, exprTest) { } TEST(AsechTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Asech")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Asech"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/AsinhTests.cpp b/tests/src/functions/hyperbolic/AsinhTests.cpp index d98130ea5..0eccdfbd8 100644 --- a/tests/src/functions/hyperbolic/AsinhTests.cpp +++ b/tests/src/functions/hyperbolic/AsinhTests.cpp @@ -54,6 +54,6 @@ TEST(AsinhTests, exprTest) { } TEST(AsinhTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Asinh")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Asinh"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/AtanhTests.cpp b/tests/src/functions/hyperbolic/AtanhTests.cpp index 5e03e874e..77f264830 100644 --- a/tests/src/functions/hyperbolic/AtanhTests.cpp +++ b/tests/src/functions/hyperbolic/AtanhTests.cpp @@ -57,6 +57,6 @@ TEST(AtanhTests, exprTest) { } TEST(AtanhTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Atanh")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Atanh"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/CoshTests.cpp b/tests/src/functions/hyperbolic/CoshTests.cpp index 0e20c1fe1..4df0ffc25 100644 --- a/tests/src/functions/hyperbolic/CoshTests.cpp +++ b/tests/src/functions/hyperbolic/CoshTests.cpp @@ -54,6 +54,6 @@ TEST(CoshTests, exprTest) { } TEST(CoshTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Cosh")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Cosh"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/CothTests.cpp b/tests/src/functions/hyperbolic/CothTests.cpp index 8cab1c1ce..ea2feca67 100644 --- a/tests/src/functions/hyperbolic/CothTests.cpp +++ b/tests/src/functions/hyperbolic/CothTests.cpp @@ -55,6 +55,6 @@ TEST(CothTests, exprTest) { } TEST(CothTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Coth")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Coth"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/CschTests.cpp b/tests/src/functions/hyperbolic/CschTests.cpp index 869ba2604..3ec09c1dc 100644 --- a/tests/src/functions/hyperbolic/CschTests.cpp +++ b/tests/src/functions/hyperbolic/CschTests.cpp @@ -54,6 +54,6 @@ TEST(CschTests, exprTest) { } TEST(CschTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Csch")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Csch"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/SechTests.cpp b/tests/src/functions/hyperbolic/SechTests.cpp index 994a3af29..675400b6f 100644 --- a/tests/src/functions/hyperbolic/SechTests.cpp +++ b/tests/src/functions/hyperbolic/SechTests.cpp @@ -55,6 +55,6 @@ TEST(SechTests, exprTest) { } TEST(SechTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sech")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sech"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/SinhTests.cpp b/tests/src/functions/hyperbolic/SinhTests.cpp index be95b8943..1928fd5dd 100644 --- a/tests/src/functions/hyperbolic/SinhTests.cpp +++ b/tests/src/functions/hyperbolic/SinhTests.cpp @@ -54,6 +54,6 @@ TEST(SinhTests, exprTest) { } TEST(SinhTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sinh")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sinh"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/hyperbolic/TanhTests.cpp b/tests/src/functions/hyperbolic/TanhTests.cpp index 893a162c1..54a0a3ca6 100644 --- a/tests/src/functions/hyperbolic/TanhTests.cpp +++ b/tests/src/functions/hyperbolic/TanhTests.cpp @@ -54,6 +54,6 @@ TEST(TanhTests, exprTest) { } TEST(TanhTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Tanh")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Tanh"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/logarithms/LbTests.cpp b/tests/src/functions/logarithms/LbTests.cpp index 40b7c50df..2168123cc 100644 --- a/tests/src/functions/logarithms/LbTests.cpp +++ b/tests/src/functions/logarithms/LbTests.cpp @@ -50,6 +50,6 @@ TEST(LbTests, exprTest) { } TEST(LbTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Lb")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Lb"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/logarithms/LgTests.cpp b/tests/src/functions/logarithms/LgTests.cpp index 4b2aa8ef7..19010d9fa 100644 --- a/tests/src/functions/logarithms/LgTests.cpp +++ b/tests/src/functions/logarithms/LgTests.cpp @@ -50,6 +50,6 @@ TEST(LgTests, exprTest) { } TEST(LgTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Lg")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Lg"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/logarithms/LnTests.cpp b/tests/src/functions/logarithms/LnTests.cpp index 507007b09..4666aa6d5 100644 --- a/tests/src/functions/logarithms/LnTests.cpp +++ b/tests/src/functions/logarithms/LnTests.cpp @@ -52,6 +52,6 @@ TEST(LnTests, exprTest) { } TEST(LnTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Ln")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Ln"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/logarithms/LogTests.cpp b/tests/src/functions/logarithms/LogTests.cpp index d3e402ebf..3480d6252 100644 --- a/tests/src/functions/logarithms/LogTests.cpp +++ b/tests/src/functions/logarithms/LogTests.cpp @@ -132,6 +132,6 @@ TEST(LogTests, exprTest) { } TEST(LogTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Log")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Log"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/logic/AndOperTests.cpp b/tests/src/functions/logic/AndOperTests.cpp index 70dd3b569..f3cc302fb 100644 --- a/tests/src/functions/logic/AndOperTests.cpp +++ b/tests/src/functions/logic/AndOperTests.cpp @@ -52,6 +52,6 @@ TEST(AndOperTests, callTest) { } TEST(AndOperTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("AndOper")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "AndOper"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/logic/AndTests.cpp b/tests/src/functions/logic/AndTests.cpp index a4ef4fa7b..a3abd7768 100644 --- a/tests/src/functions/logic/AndTests.cpp +++ b/tests/src/functions/logic/AndTests.cpp @@ -63,6 +63,6 @@ TEST(AndTests, exprTest) { } TEST(AndTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("And")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "And"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/logic/EquivTests.cpp b/tests/src/functions/logic/EquivTests.cpp index 77e3184a3..6e190f64c 100644 --- a/tests/src/functions/logic/EquivTests.cpp +++ b/tests/src/functions/logic/EquivTests.cpp @@ -56,6 +56,6 @@ TEST(EquivTests, exprTest) { } TEST(EquivTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Equiv")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Equiv"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/logic/ImplTests.cpp b/tests/src/functions/logic/ImplTests.cpp index 2db8b0533..9f4c5a70d 100644 --- a/tests/src/functions/logic/ImplTests.cpp +++ b/tests/src/functions/logic/ImplTests.cpp @@ -56,6 +56,6 @@ TEST(ImplTests, exprTest) { } TEST(ImplTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Impl")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Impl"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/logic/NequivTests.cpp b/tests/src/functions/logic/NequivTests.cpp index 3f925c34b..400156eb8 100644 --- a/tests/src/functions/logic/NequivTests.cpp +++ b/tests/src/functions/logic/NequivTests.cpp @@ -56,6 +56,6 @@ TEST(NequivTests, exprTest) { } TEST(NequivTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Nequiv")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Nequiv"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/logic/NotTests.cpp b/tests/src/functions/logic/NotTests.cpp index 45f46368e..2ab7adddb 100644 --- a/tests/src/functions/logic/NotTests.cpp +++ b/tests/src/functions/logic/NotTests.cpp @@ -54,6 +54,6 @@ TEST(NotTests, exprTest) { } TEST(NotTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Not")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Not"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/logic/OrOperTests.cpp b/tests/src/functions/logic/OrOperTests.cpp index 915f03b78..affe97223 100644 --- a/tests/src/functions/logic/OrOperTests.cpp +++ b/tests/src/functions/logic/OrOperTests.cpp @@ -52,6 +52,6 @@ TEST(OrOperTests, callTest) { } TEST(OrOperTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("OrOper")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "OrOper"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/logic/OrTests.cpp b/tests/src/functions/logic/OrTests.cpp index 39ae6cb55..efc8089b6 100644 --- a/tests/src/functions/logic/OrTests.cpp +++ b/tests/src/functions/logic/OrTests.cpp @@ -63,6 +63,6 @@ TEST(OrTests, exprTest) { } TEST(OrTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Or")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Or"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/ntheory/CeilTests.cpp b/tests/src/functions/ntheory/CeilTests.cpp index 4b2c7ef16..76ad3c129 100644 --- a/tests/src/functions/ntheory/CeilTests.cpp +++ b/tests/src/functions/ntheory/CeilTests.cpp @@ -80,6 +80,6 @@ TEST(CeilTests, exprTest) { } TEST(CeilTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Ceil")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Ceil"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/ntheory/FloorTests.cpp b/tests/src/functions/ntheory/FloorTests.cpp index bb2f678c6..2c5e0120c 100644 --- a/tests/src/functions/ntheory/FloorTests.cpp +++ b/tests/src/functions/ntheory/FloorTests.cpp @@ -80,6 +80,6 @@ TEST(FloorTests, exprTest) { } TEST(FloorTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Floor")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Floor"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/ntheory/ModTests.cpp b/tests/src/functions/ntheory/ModTests.cpp index 60beb28cb..2de2d5f8c 100644 --- a/tests/src/functions/ntheory/ModTests.cpp +++ b/tests/src/functions/ntheory/ModTests.cpp @@ -99,6 +99,6 @@ TEST(ModTests, exprTest) { } TEST(ModTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Mod")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Mod"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/other/CommaTests.cpp b/tests/src/functions/other/CommaTests.cpp index d0a770d3e..d769dc380 100644 --- a/tests/src/functions/other/CommaTests.cpp +++ b/tests/src/functions/other/CommaTests.cpp @@ -51,6 +51,6 @@ TEST(CommaTests, exprTest) { } TEST(CommaTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Comma")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Comma"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/other/DegTests.cpp b/tests/src/functions/other/DegTests.cpp index b61eb4f2a..b01a7171e 100644 --- a/tests/src/functions/other/DegTests.cpp +++ b/tests/src/functions/other/DegTests.cpp @@ -56,6 +56,6 @@ TEST(DegTests, degTest) { } TEST(DegTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Deg")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Deg"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/other/FactorialTests.cpp b/tests/src/functions/other/FactorialTests.cpp index 83cc4f5fd..92c0f0ad2 100644 --- a/tests/src/functions/other/FactorialTests.cpp +++ b/tests/src/functions/other/FactorialTests.cpp @@ -138,6 +138,6 @@ TEST(FactorialTests, exprTest) { } TEST(FactorialTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Factorial")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Factorial"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/other/IndexTests.cpp b/tests/src/functions/other/IndexTests.cpp index 3f147c0cd..b15baf11a 100644 --- a/tests/src/functions/other/IndexTests.cpp +++ b/tests/src/functions/other/IndexTests.cpp @@ -63,6 +63,6 @@ TEST(IndexTests, exprTest) { } TEST(IndexTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Index")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Index"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/other/PercentTests.cpp b/tests/src/functions/other/PercentTests.cpp index c59b87b0f..e1812b26f 100644 --- a/tests/src/functions/other/PercentTests.cpp +++ b/tests/src/functions/other/PercentTests.cpp @@ -55,6 +55,6 @@ TEST(PercentTests, degTest) { } TEST(PercentTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Percent")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Percent"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/powers/ExpTests.cpp b/tests/src/functions/powers/ExpTests.cpp index 536fcf0df..c00995609 100644 --- a/tests/src/functions/powers/ExpTests.cpp +++ b/tests/src/functions/powers/ExpTests.cpp @@ -46,6 +46,6 @@ TEST(ExpTests, exprTest) { } TEST(ExpTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Exp")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Exp"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/powers/PowOperTests.cpp b/tests/src/functions/powers/PowOperTests.cpp index 3231fcd23..86579ba42 100644 --- a/tests/src/functions/powers/PowOperTests.cpp +++ b/tests/src/functions/powers/PowOperTests.cpp @@ -55,6 +55,6 @@ TEST(PowOperTests, callTest) { } TEST(PowOperTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("PowOper")); - EXPECT_EQ(f.getClass().getParent(), IOperator::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "PowOper"); + EXPECT_EQ(f.getClass()->getParent(), IOperator::getClassStatic()); } diff --git a/tests/src/functions/powers/PowTests.cpp b/tests/src/functions/powers/PowTests.cpp index db65f1c68..383723c0a 100644 --- a/tests/src/functions/powers/PowTests.cpp +++ b/tests/src/functions/powers/PowTests.cpp @@ -161,6 +161,6 @@ TEST(PowTests, exprTest) { } TEST(PowTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Pow")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Pow"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/powers/RootTests.cpp b/tests/src/functions/powers/RootTests.cpp index 2682dcfe8..1fc401358 100644 --- a/tests/src/functions/powers/RootTests.cpp +++ b/tests/src/functions/powers/RootTests.cpp @@ -182,6 +182,6 @@ TEST(RootTests, exprTest) { } TEST(RootTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Root")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Root"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/powers/SqrTests.cpp b/tests/src/functions/powers/SqrTests.cpp index 1989ccbd0..bcffcb2c5 100644 --- a/tests/src/functions/powers/SqrTests.cpp +++ b/tests/src/functions/powers/SqrTests.cpp @@ -51,6 +51,6 @@ TEST(SqrTests, exprTest) { } TEST(SqrTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sqr")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sqr"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/powers/SqrtTests.cpp b/tests/src/functions/powers/SqrtTests.cpp index 834bfd96a..a9edf5065 100644 --- a/tests/src/functions/powers/SqrtTests.cpp +++ b/tests/src/functions/powers/SqrtTests.cpp @@ -70,6 +70,6 @@ TEST(SqrtTests, exprTest) { } TEST(SqrtTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sqrt")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sqrt"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/AcosTests.cpp b/tests/src/functions/trigonometry/AcosTests.cpp index d20784e40..586161d44 100644 --- a/tests/src/functions/trigonometry/AcosTests.cpp +++ b/tests/src/functions/trigonometry/AcosTests.cpp @@ -57,6 +57,6 @@ TEST(AcosTests, exprTest) { } TEST(AcosTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Acos")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Acos"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/AcotTests.cpp b/tests/src/functions/trigonometry/AcotTests.cpp index 9fb5dea39..dade7662b 100644 --- a/tests/src/functions/trigonometry/AcotTests.cpp +++ b/tests/src/functions/trigonometry/AcotTests.cpp @@ -57,6 +57,6 @@ TEST(AcotTests, exprTest) { } TEST(AcotTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Acot")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Acot"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/AcscTests.cpp b/tests/src/functions/trigonometry/AcscTests.cpp index c07382cf3..c5d9ca09b 100644 --- a/tests/src/functions/trigonometry/AcscTests.cpp +++ b/tests/src/functions/trigonometry/AcscTests.cpp @@ -58,6 +58,6 @@ TEST(AcscTests, exprTest) { } TEST(AcscTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Acsc")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Acsc"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/AsecTests.cpp b/tests/src/functions/trigonometry/AsecTests.cpp index 761bf6f0e..8c0cbab3d 100644 --- a/tests/src/functions/trigonometry/AsecTests.cpp +++ b/tests/src/functions/trigonometry/AsecTests.cpp @@ -58,6 +58,6 @@ TEST(AsecTests, exprTest) { } TEST(AsecTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Asec")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Asec"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/AsinTests.cpp b/tests/src/functions/trigonometry/AsinTests.cpp index 70ee6b802..43213ad90 100644 --- a/tests/src/functions/trigonometry/AsinTests.cpp +++ b/tests/src/functions/trigonometry/AsinTests.cpp @@ -57,6 +57,6 @@ TEST(AsinTests, exprTest) { } TEST(AsinTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Asin")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Asin"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/AtanTests.cpp b/tests/src/functions/trigonometry/AtanTests.cpp index daecb8475..1301ac948 100644 --- a/tests/src/functions/trigonometry/AtanTests.cpp +++ b/tests/src/functions/trigonometry/AtanTests.cpp @@ -57,6 +57,6 @@ TEST(AtanTests, exprTest) { } TEST(AtanTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Atan")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Atan"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/CosTests.cpp b/tests/src/functions/trigonometry/CosTests.cpp index 00390d60b..2f7749643 100644 --- a/tests/src/functions/trigonometry/CosTests.cpp +++ b/tests/src/functions/trigonometry/CosTests.cpp @@ -54,6 +54,6 @@ TEST(CosTests, exprTest) { } TEST(CosTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Cos")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Cos"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/CotTests.cpp b/tests/src/functions/trigonometry/CotTests.cpp index 1b59d95bb..10e98f763 100644 --- a/tests/src/functions/trigonometry/CotTests.cpp +++ b/tests/src/functions/trigonometry/CotTests.cpp @@ -55,6 +55,6 @@ TEST(CotTests, exprTest) { } TEST(CotTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Cot")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Cot"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/CscTests.cpp b/tests/src/functions/trigonometry/CscTests.cpp index 448ae0d1a..5bb542564 100644 --- a/tests/src/functions/trigonometry/CscTests.cpp +++ b/tests/src/functions/trigonometry/CscTests.cpp @@ -54,6 +54,6 @@ TEST(CscTests, exprTest) { } TEST(CscTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Csc")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Csc"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/SecTests.cpp b/tests/src/functions/trigonometry/SecTests.cpp index 7c829d22e..9e3aa5a8d 100644 --- a/tests/src/functions/trigonometry/SecTests.cpp +++ b/tests/src/functions/trigonometry/SecTests.cpp @@ -54,6 +54,6 @@ TEST(SecTests, exprTest) { } TEST(SecTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sec")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sec"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/SinTests.cpp b/tests/src/functions/trigonometry/SinTests.cpp index 3f12fb12e..bf5dea866 100644 --- a/tests/src/functions/trigonometry/SinTests.cpp +++ b/tests/src/functions/trigonometry/SinTests.cpp @@ -54,6 +54,6 @@ TEST(SinTests, exprTest) { } TEST(SinTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Sin")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Sin"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/functions/trigonometry/TanTests.cpp b/tests/src/functions/trigonometry/TanTests.cpp index 4436c13df..be16e5a6f 100644 --- a/tests/src/functions/trigonometry/TanTests.cpp +++ b/tests/src/functions/trigonometry/TanTests.cpp @@ -55,6 +55,6 @@ TEST(TanTests, exprTest) { } TEST(TanTests, getClassTest) { - EXPECT_EQ(f.getClass(), MathObjectClass("Tan")); - EXPECT_EQ(f.getClass().getParent(), IFunction::getClassStatic()); + EXPECT_EQ(f.getClass()->getName(), "Tan"); + EXPECT_EQ(f.getClass()->getParent(), IFunction::getClassStatic()); } diff --git a/tests/src/literals/BooleanTests.cpp b/tests/src/literals/BooleanTests.cpp index a4151328a..a888038ae 100644 --- a/tests/src/literals/BooleanTests.cpp +++ b/tests/src/literals/BooleanTests.cpp @@ -45,6 +45,6 @@ TEST(BooleanTests, opearatorsTest) { } TEST(BooleanTest, getClassTest) { - EXPECT_EQ(Boolean().getClass(), MathObjectClass("Boolean")); - EXPECT_EQ(Boolean().getClass().getParent(), ILiteral::getClassStatic()); + EXPECT_EQ(Boolean().getClass()->getName(), "Boolean"); + EXPECT_EQ(Boolean().getClass()->getParent(), ILiteral::getClassStatic()); } diff --git a/tests/src/literals/ILiteralTests.cpp b/tests/src/literals/ILiteralTests.cpp index e3b0ea6f2..21594c1b8 100644 --- a/tests/src/literals/ILiteralTests.cpp +++ b/tests/src/literals/ILiteralTests.cpp @@ -10,8 +10,8 @@ using namespace fintamath; namespace { -class TestLiteral final : public ILiteralCRTP { - FINTAMATH_CLASS_BODY(TestLiteral) +class TestLiteral : public ILiteralCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestLiteral, ILiteral) }; [[maybe_unused]] const auto config = [] { @@ -46,6 +46,6 @@ TEST(ILiteralTests, equalsTest) { } TEST(ILiteralTests, getClassTest) { - EXPECT_EQ(ILiteral::getClassStatic(), MathObjectClass("ILiteral")); - EXPECT_EQ(ILiteral::getClassStatic().getParent(), IMathObject::getClassStatic()); + EXPECT_EQ(ILiteral::getClassStatic()->getName(), "ILiteral"); + EXPECT_EQ(ILiteral::getClassStatic()->getParent(), IMathObject::getClassStatic()); } diff --git a/tests/src/literals/VariableTests.cpp b/tests/src/literals/VariableTests.cpp index 3e21e0440..223af20a2 100644 --- a/tests/src/literals/VariableTests.cpp +++ b/tests/src/literals/VariableTests.cpp @@ -39,6 +39,6 @@ TEST(VariableTest, stringIntegerConstructorTest) { } TEST(VariableTest, getClassTest) { - EXPECT_EQ(Variable("a").getClass(), MathObjectClass("Variable")); - EXPECT_EQ(Variable("a").getClass().getParent(), ILiteral::getClassStatic()); + EXPECT_EQ(Variable("a").getClass()->getName(), "Variable"); + EXPECT_EQ(Variable("a").getClass()->getParent(), ILiteral::getClassStatic()); } diff --git a/tests/src/literals/constants/ComplexInfTests.cpp b/tests/src/literals/constants/ComplexInfTests.cpp index 2016ba46a..d09a4ff2c 100644 --- a/tests/src/literals/constants/ComplexInfTests.cpp +++ b/tests/src/literals/constants/ComplexInfTests.cpp @@ -16,6 +16,6 @@ TEST(ComplexInfTests, callTest) { } TEST(ComplexInfTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("ComplexInf")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "ComplexInf"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/ETests.cpp b/tests/src/literals/constants/ETests.cpp index c6426cb87..fe6371b7d 100644 --- a/tests/src/literals/constants/ETests.cpp +++ b/tests/src/literals/constants/ETests.cpp @@ -16,6 +16,6 @@ TEST(ETests, callTest) { } TEST(ETests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("E")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "E"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/FalseTests.cpp b/tests/src/literals/constants/FalseTests.cpp index 4e15beeb4..048fafc5e 100644 --- a/tests/src/literals/constants/FalseTests.cpp +++ b/tests/src/literals/constants/FalseTests.cpp @@ -18,6 +18,6 @@ TEST(FalseTests, callTest) { } TEST(FalseTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("False")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "False"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/IConstantTests.cpp b/tests/src/literals/constants/IConstantTests.cpp index ca95f4b01..da1ad210d 100644 --- a/tests/src/literals/constants/IConstantTests.cpp +++ b/tests/src/literals/constants/IConstantTests.cpp @@ -9,8 +9,8 @@ using namespace fintamath; namespace { -class TestConstant final : public IConstantCRTP { - FINTAMATH_CLASS_BODY(TestConstant) +class TestConstant : public IConstantCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestConstant, IConstant) protected: std::unique_ptr call() const override { @@ -38,6 +38,6 @@ TEST(IConstantTests, callTest) { } TEST(IConstantTests, getClassTest) { - EXPECT_EQ(IConstant::getClassStatic(), MathObjectClass("IConstant")); - EXPECT_EQ(IConstant::getClassStatic().getParent(), ILiteral::getClassStatic()); + EXPECT_EQ(IConstant::getClassStatic()->getName(), "IConstant"); + EXPECT_EQ(IConstant::getClassStatic()->getParent(), ILiteral::getClassStatic()); } diff --git a/tests/src/literals/constants/ITests.cpp b/tests/src/literals/constants/ITests.cpp index 546782604..3bfd647ea 100644 --- a/tests/src/literals/constants/ITests.cpp +++ b/tests/src/literals/constants/ITests.cpp @@ -16,6 +16,6 @@ TEST(ITests, callTest) { } TEST(ITests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("I")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "I"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/InfTests.cpp b/tests/src/literals/constants/InfTests.cpp index 701c6604b..672c2f2f9 100644 --- a/tests/src/literals/constants/InfTests.cpp +++ b/tests/src/literals/constants/InfTests.cpp @@ -16,6 +16,6 @@ TEST(InfTests, callTest) { } TEST(InfTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("Inf")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "Inf"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/NegInfTests.cpp b/tests/src/literals/constants/NegInfTests.cpp index 7da6d8cd3..6c0d88ae6 100644 --- a/tests/src/literals/constants/NegInfTests.cpp +++ b/tests/src/literals/constants/NegInfTests.cpp @@ -16,6 +16,6 @@ TEST(NegInfTests, callTest) { } TEST(NegInfTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("NegInf")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "NegInf"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/PiTests.cpp b/tests/src/literals/constants/PiTests.cpp index d5eede41c..6ea77df09 100644 --- a/tests/src/literals/constants/PiTests.cpp +++ b/tests/src/literals/constants/PiTests.cpp @@ -16,6 +16,6 @@ TEST(PiTests, callTest) { } TEST(PiTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("Pi")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "Pi"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/TrueTests.cpp b/tests/src/literals/constants/TrueTests.cpp index 8312b0c14..0d88148f1 100644 --- a/tests/src/literals/constants/TrueTests.cpp +++ b/tests/src/literals/constants/TrueTests.cpp @@ -18,6 +18,6 @@ TEST(TrueTests, callTest) { } TEST(TrueTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("True")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "True"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/literals/constants/UndefinedTests.cpp b/tests/src/literals/constants/UndefinedTests.cpp index 3a1254754..d88f2e835 100644 --- a/tests/src/literals/constants/UndefinedTests.cpp +++ b/tests/src/literals/constants/UndefinedTests.cpp @@ -16,6 +16,6 @@ TEST(UndefinedTests, callTest) { } TEST(UndefinedTests, getClassTest) { - EXPECT_EQ(c.getClass(), MathObjectClass("Undefined")); - EXPECT_EQ(c.getClass().getParent(), IConstant::getClassStatic()); + EXPECT_EQ(c.getClass()->getName(), "Undefined"); + EXPECT_EQ(c.getClass()->getParent(), IConstant::getClassStatic()); } diff --git a/tests/src/numbers/ComplexTests.cpp b/tests/src/numbers/ComplexTests.cpp index 18c66a891..412148a51 100644 --- a/tests/src/numbers/ComplexTests.cpp +++ b/tests/src/numbers/ComplexTests.cpp @@ -906,6 +906,6 @@ TEST(ComplexTests, isComplexTest) { } TEST(ComplexTests, getClassTest) { - EXPECT_EQ(Complex().getClass(), MathObjectClass("Complex")); - EXPECT_EQ(Complex().getClass().getParent(), INumber::getClassStatic()); + EXPECT_EQ(Complex().getClass()->getName(), "Complex"); + EXPECT_EQ(Complex().getClass()->getParent(), INumber::getClassStatic()); } diff --git a/tests/src/numbers/INumberTests.cpp b/tests/src/numbers/INumberTests.cpp index 72bb21d86..1fde1edab 100644 --- a/tests/src/numbers/INumberTests.cpp +++ b/tests/src/numbers/INumberTests.cpp @@ -9,8 +9,8 @@ using namespace fintamath; namespace { -class TestNumber final : public INumberCRTP { - FINTAMATH_CLASS_BODY(TestNumber) +class TestNumber : public INumberCRTP { + FINTAMATH_PARENT_CLASS_BODY(TestNumber, INumber) protected: TestNumber &add(const TestNumber &rhs) override { @@ -129,6 +129,6 @@ TEST(INumberTests, negateTest) { } TEST(INumberTests, getClassTest) { - EXPECT_EQ(INumber::getClassStatic(), MathObjectClass("INumber")); - EXPECT_EQ(INumber::getClassStatic().getParent(), IComparable::getClassStatic()); + EXPECT_EQ(INumber::getClassStatic()->getName(), "INumber"); + EXPECT_EQ(INumber::getClassStatic()->getParent(), IComparable::getClassStatic()); } diff --git a/tests/src/numbers/IntegerTests.cpp b/tests/src/numbers/IntegerTests.cpp index e1dc2d504..5fedad20f 100644 --- a/tests/src/numbers/IntegerTests.cpp +++ b/tests/src/numbers/IntegerTests.cpp @@ -609,8 +609,8 @@ TEST(IntegerTests, equalsTest) { } TEST(IntegerTests, getClassTest) { - EXPECT_EQ(Integer().getClass(), MathObjectClass("Integer")); - EXPECT_EQ(Integer().getClass().getParent(), INumber::getClassStatic()); + EXPECT_EQ(Integer().getClass()->getName(), "Integer"); + EXPECT_EQ(Integer().getClass()->getParent(), INumber::getClassStatic()); } TEST(IntegerTests, hashTest) { diff --git a/tests/src/numbers/RationalTests.cpp b/tests/src/numbers/RationalTests.cpp index ee5ded2f4..02ce09cb7 100644 --- a/tests/src/numbers/RationalTests.cpp +++ b/tests/src/numbers/RationalTests.cpp @@ -504,8 +504,8 @@ TEST(RationalTests, isComplexTest) { } TEST(RationalTests, getClassTest) { - EXPECT_EQ(Rational().getClass(), MathObjectClass("Rational")); - EXPECT_EQ(Rational().getClass().getParent(), INumber::getClassStatic()); + EXPECT_EQ(Rational().getClass()->getName(), "Rational"); + EXPECT_EQ(Rational().getClass()->getParent(), INumber::getClassStatic()); } TEST(RationalTests, hashTest) { diff --git a/tests/src/numbers/RealTests.cpp b/tests/src/numbers/RealTests.cpp index c9acd2b07..de7971df4 100644 --- a/tests/src/numbers/RealTests.cpp +++ b/tests/src/numbers/RealTests.cpp @@ -1044,8 +1044,8 @@ TEST(RealTests, isComplexTest) { } TEST(RealTests, getClassTest) { - EXPECT_EQ(Real().getClass(), MathObjectClass("Real")); - EXPECT_EQ(Real().getClass().getParent(), INumber::getClassStatic()); + EXPECT_EQ(Real().getClass()->getName(), "Real"); + EXPECT_EQ(Real().getClass()->getParent(), INumber::getClassStatic()); } TEST(RealTests, hashTest) {