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..01c6f603d 100644 --- a/include/fintamath/core/MathObjectBody.hpp +++ b/include/fintamath/core/MathObjectBody.hpp @@ -3,43 +3,53 @@ #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}; \ - } \ - \ +#define FINTAMATH_CLASS_BODY(Class, ParentClass) \ +public: \ + using Parent = ParentClass; \ + \ + static MathObjectClass getClassStatic() noexcept; \ + \ private: -#define FINTAMATH_PARENT_CLASS_BODY(Class) \ - FINTAMATH_CLASS_BODY(Class) \ +#define FINTAMATH_CLASS_IMPLEMENTATION(Class) \ + MathObjectClass Class::getClassStatic() noexcept { \ + static const detail::MathObjectClassImpl \ + classImpl{#Class, Parent::getClassStatic()}; \ + return &classImpl; \ + } + +#define FINTAMATH_PARENT_CLASS_BODY(Class, ParentClass) \ + FINTAMATH_CLASS_BODY(Class, ParentClass) \ \ 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) \ + FINTAMATH_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..80a6f3185 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); +constexpr 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..b644f485f --- /dev/null +++ b/include/fintamath/core/None.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include "fintamath/core/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..181b5ce6d 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_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..92e7322c5 100644 --- a/include/fintamath/functions/IFunctionCRTP.hpp +++ b/include/fintamath/functions/IFunctionCRTP.hpp @@ -14,21 +14,22 @@ class IFunctionCRTP_ : public IFunction { #undef I_MATH_OBJECT_CRTP public: - static constexpr auto getArgumentClassesStatic() { - return std::array{Args::getClassStatic()...}; + static const auto &getArgumentClassesStatic() noexcept { + static const std::array argClasses{Args::getClassStatic()...}; + return argClasses; } - const std::vector &getArgumentClasses() const final { - constexpr auto argClassesArr = getArgumentClassesStatic(); - static const std::vector argClassesVect(argClassesArr.begin(), argClassesArr.end()); + const std::vector &getArgumentClasses() const noexcept final { + static const auto &argClasses = getArgumentClassesStatic(); + static const std::vector argClassesVect(argClasses.begin(), argClasses.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..845434fbe 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_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..431f92313 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_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..2ac479fa0 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_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..8808c8ad7 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_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..147723f28 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_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..103ae1731 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_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..2b49762a0 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_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..c62371a8b 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_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..e1692d90f 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_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..801b03480 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_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..0569bcba1 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_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..96a87729c 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_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..d7323b46c 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_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..27eb128ed 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_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..82ebc379a 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_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..f3c39cc83 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_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..2e3ad3d4e 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_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..4d454708f 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_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..0ed74acb2 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_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..0f6db75a5 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_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..068d3b2ca 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_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..b7e552c7f 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_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..4c4f95abd 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_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..66544cf67 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_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..ae4e9ce3d 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_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..589023f7a 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_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..f385b01c4 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_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..068d869f4 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_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..dda89a707 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_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..f549aaa8c 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_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..12421e8ee 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_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..62c99a969 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_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..33f1947ac 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_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..5f6b7a31f 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_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..d52a0419a 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_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..ea23e51cc 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_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..8b3a59dc5 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_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..22851e261 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_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..0f583d01a 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_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..ecd706017 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_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..0bc5ad643 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_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..356671079 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_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..4c3a5e012 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_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..7f9e31871 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_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..4ad07a707 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_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..f3d71f9ba 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_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..1ef74b3bf 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_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..17f57f57c 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_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..231474039 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_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..6c6723109 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_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..c1bbadb14 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_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..6412f561d 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_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..5c591d557 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_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..54061f66f 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_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..064f873b1 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_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..7185efa5b 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_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..2a00bb2d6 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_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..d26c26205 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_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..e778c595d 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_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..c91eb4e2b 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_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..1004f1e13 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_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..d982ec1e8 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_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..da0d1f959 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_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..a9f28b9f3 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_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..3af2896b1 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_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..646df78a2 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_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..306a41383 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_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..121817fbc 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_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..22c0fb63f 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_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..d192d5288 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_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..cb3aeb8e7 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_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..517b09602 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_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..41bb81c78 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_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..9fbfa4dd1 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_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..ae15d933b 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_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..f22c6f686 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_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..31edb6f34 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_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..0ab11a9be 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_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..948fa6013 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_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..97dfadc90 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_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..b8852a519 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_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..0931aaa24 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_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..4330806e2 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_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..8f086a190 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_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..3a24dd4f2 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_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..09dce8c51 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_CLASS_BODY(Rational, INumber) public: Rational() = default; diff --git a/include/fintamath/numbers/Real.hpp b/include/fintamath/numbers/Real.hpp index ffa942fc5..f957ecf14 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_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/Expression.cpp b/src/fintamath/expressions/Expression.cpp index d626353da..f9416cb70 100644 --- a/src/fintamath/expressions/Expression.cpp +++ b/src/fintamath/expressions/Expression.cpp @@ -40,6 +40,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Expression) + using namespace detail; Expression::Expression() : child(Integer(0).clone()) { 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.cpp b/src/fintamath/expressions/FunctionExpression.cpp index 15c3e7811..8736acab1 100644 --- a/src/fintamath/expressions/FunctionExpression.cpp +++ b/src/fintamath/expressions/FunctionExpression.cpp @@ -12,6 +12,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(FunctionExpression) + using namespace detail; FunctionExpression::FunctionExpression(const IFunction &inFunc, ArgumentPtrVector inChildren) diff --git a/src/fintamath/expressions/FunctionExpression.hpp b/src/fintamath/expressions/FunctionExpression.hpp index ea7c486a0..2e9781357 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_CLASS_BODY(FunctionExpression, IExpression) public: explicit FunctionExpression(const IFunction &inFunc, ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/IExpression.cpp b/src/fintamath/expressions/IExpression.cpp index aa1929462..9a863dac0 100644 --- a/src/fintamath/expressions/IExpression.cpp +++ b/src/fintamath/expressions/IExpression.cpp @@ -25,10 +25,10 @@ namespace fintamath { -using namespace detail; - FINTAMATH_PARENT_CLASS_IMPLEMENTATION(IExpression) +using namespace detail; + std::vector IExpression::getVariables() const { std::vector vars; diff --git a/src/fintamath/expressions/binary/CompExpr.cpp b/src/fintamath/expressions/binary/CompExpr.cpp index 7fa592e20..68799864e 100644 --- a/src/fintamath/expressions/binary/CompExpr.cpp +++ b/src/fintamath/expressions/binary/CompExpr.cpp @@ -34,6 +34,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(CompExpr) + using namespace detail; CompExpr::CompExpr(const IOperator &inOper, ArgumentPtr inLhsChild, ArgumentPtr inRhsChild) diff --git a/src/fintamath/expressions/binary/CompExpr.hpp b/src/fintamath/expressions/binary/CompExpr.hpp index 225bfc9d7..24167f2d7 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_CLASS_BODY(CompExpr, IBinaryExpression) public: CompExpr(const IOperator &inOper, ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/DerivativeExpr.cpp b/src/fintamath/expressions/binary/DerivativeExpr.cpp index a51b7c5bf..f18752277 100644 --- a/src/fintamath/expressions/binary/DerivativeExpr.cpp +++ b/src/fintamath/expressions/binary/DerivativeExpr.cpp @@ -55,6 +55,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(DerivativeExpr) + using namespace detail; using NameToSimplifyFunctionMap = std::unordered_map< diff --git a/src/fintamath/expressions/binary/DerivativeExpr.hpp b/src/fintamath/expressions/binary/DerivativeExpr.hpp index 89c5e6568..a67bb3714 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_CLASS_BODY(DerivativeExpr, IBinaryExpression) public: explicit DerivativeExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/DivExpr.cpp b/src/fintamath/expressions/binary/DivExpr.cpp index db32f823f..9257c2920 100644 --- a/src/fintamath/expressions/binary/DivExpr.cpp +++ b/src/fintamath/expressions/binary/DivExpr.cpp @@ -39,6 +39,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(DivExpr) + using namespace detail; DivExpr::DivExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild) diff --git a/src/fintamath/expressions/binary/DivExpr.hpp b/src/fintamath/expressions/binary/DivExpr.hpp index 34ff07184..fc241978a 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_CLASS_BODY(DivExpr, IBinaryExpression) public: explicit DivExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/IntegralExpr.cpp b/src/fintamath/expressions/binary/IntegralExpr.cpp index cdcea0afb..4d4348eff 100644 --- a/src/fintamath/expressions/binary/IntegralExpr.cpp +++ b/src/fintamath/expressions/binary/IntegralExpr.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(IntegralExpr) + IntegralExpr::IntegralExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild) : IBinaryExpressionCRTP(Integral{}, std::move(inLhsChild), std::move(inRhsChild)) { } diff --git a/src/fintamath/expressions/binary/IntegralExpr.hpp b/src/fintamath/expressions/binary/IntegralExpr.hpp index 0682f4553..ea2fdc09f 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_CLASS_BODY(IntegralExpr, IBinaryExpression) public: explicit IntegralExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/LogExpr.cpp b/src/fintamath/expressions/binary/LogExpr.cpp index 236174e10..bca97021a 100644 --- a/src/fintamath/expressions/binary/LogExpr.cpp +++ b/src/fintamath/expressions/binary/LogExpr.cpp @@ -22,6 +22,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(LogExpr) + using namespace detail; LogExpr::LogExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild) diff --git a/src/fintamath/expressions/binary/LogExpr.hpp b/src/fintamath/expressions/binary/LogExpr.hpp index 57bc9b178..a27eb15aa 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_CLASS_BODY(LogExpr, IBinaryExpression) public: explicit LogExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/binary/PowExpr.cpp b/src/fintamath/expressions/binary/PowExpr.cpp index eb2214b17..0be2aa51a 100644 --- a/src/fintamath/expressions/binary/PowExpr.cpp +++ b/src/fintamath/expressions/binary/PowExpr.cpp @@ -36,6 +36,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(PowExpr) + using namespace detail; constexpr int64_t maxPreciseRoot = 9; diff --git a/src/fintamath/expressions/binary/PowExpr.hpp b/src/fintamath/expressions/binary/PowExpr.hpp index 7345201fa..7e478c683 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_CLASS_BODY(PowExpr, IBinaryExpression) public: explicit PowExpr(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild); diff --git a/src/fintamath/expressions/interfaces/IBinaryExpression.cpp b/src/fintamath/expressions/interfaces/IBinaryExpression.cpp index a03e319d8..64333a0ef 100644 --- a/src/fintamath/expressions/interfaces/IBinaryExpression.cpp +++ b/src/fintamath/expressions/interfaces/IBinaryExpression.cpp @@ -12,10 +12,10 @@ namespace fintamath { -using namespace detail; - FINTAMATH_PARENT_CLASS_IMPLEMENTATION(IBinaryExpression) +using namespace detail; + IBinaryExpression::IBinaryExpression(const IFunction &inFunc, ArgumentPtr lhs, ArgumentPtr rhs) : func(cast(inFunc.clone())), lhsChild(std::move(lhs)), diff --git a/src/fintamath/expressions/interfaces/IPolynomExpression.cpp b/src/fintamath/expressions/interfaces/IPolynomExpression.cpp index 363574e83..d2b1925bc 100644 --- a/src/fintamath/expressions/interfaces/IPolynomExpression.cpp +++ b/src/fintamath/expressions/interfaces/IPolynomExpression.cpp @@ -22,10 +22,10 @@ namespace fintamath { -using namespace detail; - FINTAMATH_PARENT_CLASS_IMPLEMENTATION(IPolynomExpression) +using namespace detail; + IPolynomExpression::IPolynomExpression(const IFunction &inFunc, ArgumentPtrVector args) : func(cast(inFunc.clone())), children(std::move(args)) { diff --git a/src/fintamath/expressions/interfaces/IUnaryExpression.cpp b/src/fintamath/expressions/interfaces/IUnaryExpression.cpp index e0b547f06..e8a12afcc 100644 --- a/src/fintamath/expressions/interfaces/IUnaryExpression.cpp +++ b/src/fintamath/expressions/interfaces/IUnaryExpression.cpp @@ -12,10 +12,10 @@ namespace fintamath { -using namespace detail; - FINTAMATH_PARENT_CLASS_IMPLEMENTATION(IUnaryExpression) +using namespace detail; + IUnaryExpression::IUnaryExpression(const IFunction &inFunc, ArgumentPtr rhs) : func(cast(inFunc.clone())), child(std::move(rhs)) { diff --git a/src/fintamath/expressions/polynomial/AddExpr.cpp b/src/fintamath/expressions/polynomial/AddExpr.cpp index 1ad748d77..de138e5d4 100644 --- a/src/fintamath/expressions/polynomial/AddExpr.cpp +++ b/src/fintamath/expressions/polynomial/AddExpr.cpp @@ -34,6 +34,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(AddExpr) + using namespace detail; AddExpr::AddExpr(ArgumentPtrVector inChildren) diff --git a/src/fintamath/expressions/polynomial/AddExpr.hpp b/src/fintamath/expressions/polynomial/AddExpr.hpp index 5328b32f0..1396eebd8 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_CLASS_BODY(AddExpr, IPolynomExpression) public: explicit AddExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/AndExpr.cpp b/src/fintamath/expressions/polynomial/AndExpr.cpp index 3f7dc5bab..5222b39fa 100644 --- a/src/fintamath/expressions/polynomial/AndExpr.cpp +++ b/src/fintamath/expressions/polynomial/AndExpr.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(AndExpr) + AndExpr::AndExpr(ArgumentPtrVector inChildren) : IPolynomExpressionCRTP(And{}, std::move(inChildren)) { } diff --git a/src/fintamath/expressions/polynomial/AndExpr.hpp b/src/fintamath/expressions/polynomial/AndExpr.hpp index 27fcab081..16bf23a21 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_CLASS_BODY(AndExpr, IPolynomExpression) public: explicit AndExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/MinMaxExpr.cpp b/src/fintamath/expressions/polynomial/MinMaxExpr.cpp index db25af23e..4db3a6fb2 100644 --- a/src/fintamath/expressions/polynomial/MinMaxExpr.cpp +++ b/src/fintamath/expressions/polynomial/MinMaxExpr.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(MinMaxExpr) + MinMaxExpr::MinMaxExpr(const IFunction &inFunc, ArgumentPtrVector inChildren) : IPolynomExpressionCRTP(inFunc, std::move(inChildren)) { } diff --git a/src/fintamath/expressions/polynomial/MinMaxExpr.hpp b/src/fintamath/expressions/polynomial/MinMaxExpr.hpp index 983b14a65..dd1795c36 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_CLASS_BODY(MinMaxExpr, IPolynomExpression) public: explicit MinMaxExpr(const IFunction &inFunc, ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/MulExpr.cpp b/src/fintamath/expressions/polynomial/MulExpr.cpp index 69e7bd2cf..4e370ac60 100644 --- a/src/fintamath/expressions/polynomial/MulExpr.cpp +++ b/src/fintamath/expressions/polynomial/MulExpr.cpp @@ -30,6 +30,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(MulExpr) + using namespace detail; MulExpr::MulExpr(ArgumentPtrVector inChildren) diff --git a/src/fintamath/expressions/polynomial/MulExpr.hpp b/src/fintamath/expressions/polynomial/MulExpr.hpp index 01628d9f3..6fd645c61 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_CLASS_BODY(MulExpr, IPolynomExpression) public: explicit MulExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/polynomial/OrExpr.cpp b/src/fintamath/expressions/polynomial/OrExpr.cpp index 0e3042138..eea34044a 100644 --- a/src/fintamath/expressions/polynomial/OrExpr.cpp +++ b/src/fintamath/expressions/polynomial/OrExpr.cpp @@ -19,6 +19,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(OrExpr) + using namespace detail; OrExpr::OrExpr(ArgumentPtrVector inChildren) diff --git a/src/fintamath/expressions/polynomial/OrExpr.hpp b/src/fintamath/expressions/polynomial/OrExpr.hpp index e1563636e..fa479481d 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_CLASS_BODY(OrExpr, IPolynomExpression) public: explicit OrExpr(ArgumentPtrVector inChildren); diff --git a/src/fintamath/expressions/unary/AbsExpr.cpp b/src/fintamath/expressions/unary/AbsExpr.cpp index 72ff6ff08..f9792be1a 100644 --- a/src/fintamath/expressions/unary/AbsExpr.cpp +++ b/src/fintamath/expressions/unary/AbsExpr.cpp @@ -12,6 +12,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(AbsExpr) + using namespace detail; AbsExpr::AbsExpr(ArgumentPtr inChild) diff --git a/src/fintamath/expressions/unary/AbsExpr.hpp b/src/fintamath/expressions/unary/AbsExpr.hpp index ec5cf037e..bf6e98b5a 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_CLASS_BODY(AbsExpr, IUnaryExpression) public: explicit AbsExpr(ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/FloorCeilExpr.cpp b/src/fintamath/expressions/unary/FloorCeilExpr.cpp index b8cf1d472..dc56945c6 100644 --- a/src/fintamath/expressions/unary/FloorCeilExpr.cpp +++ b/src/fintamath/expressions/unary/FloorCeilExpr.cpp @@ -18,6 +18,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(FloorCeilExpr) + using namespace detail; FloorCeilExpr::FloorCeilExpr(const IFunction &inFunc, ArgumentPtr inChild) diff --git a/src/fintamath/expressions/unary/FloorCeilExpr.hpp b/src/fintamath/expressions/unary/FloorCeilExpr.hpp index e6ae04015..45c345ab0 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_CLASS_BODY(FloorCeilExpr, IUnaryExpression) public: explicit FloorCeilExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/HyperbExpr.cpp b/src/fintamath/expressions/unary/HyperbExpr.cpp index 6a773e05f..cd896c51a 100644 --- a/src/fintamath/expressions/unary/HyperbExpr.cpp +++ b/src/fintamath/expressions/unary/HyperbExpr.cpp @@ -29,6 +29,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(HyperbExpr) + using namespace detail; using NameToSimplifyFunctionMap = std::unordered_map>; diff --git a/src/fintamath/expressions/unary/HyperbExpr.hpp b/src/fintamath/expressions/unary/HyperbExpr.hpp index 3a5e5543b..6baa37bd9 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_CLASS_BODY(HyperbExpr, IUnaryExpression) public: explicit HyperbExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/InvHyperbExpr.cpp b/src/fintamath/expressions/unary/InvHyperbExpr.cpp index 9ff549e8c..89c6ed035 100644 --- a/src/fintamath/expressions/unary/InvHyperbExpr.cpp +++ b/src/fintamath/expressions/unary/InvHyperbExpr.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(InvHyperbExpr) + InvHyperbExpr::InvHyperbExpr(const IFunction &inFunc, ArgumentPtr inChild) : IUnaryExpressionCRTP(inFunc, std::move(inChild)) { } diff --git a/src/fintamath/expressions/unary/InvHyperbExpr.hpp b/src/fintamath/expressions/unary/InvHyperbExpr.hpp index 6b05440ce..659ee02bc 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_CLASS_BODY(InvHyperbExpr, IUnaryExpression) public: explicit InvHyperbExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/InvTrigExpr.cpp b/src/fintamath/expressions/unary/InvTrigExpr.cpp index eb2ef30f0..a05ee10fd 100644 --- a/src/fintamath/expressions/unary/InvTrigExpr.cpp +++ b/src/fintamath/expressions/unary/InvTrigExpr.cpp @@ -27,6 +27,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(InvTrigExpr) + using NameToSimplifyFunctionMap = std::unordered_map>; using TrigTable = std::unordered_map; diff --git a/src/fintamath/expressions/unary/InvTrigExpr.hpp b/src/fintamath/expressions/unary/InvTrigExpr.hpp index 53a187686..ca6976bdb 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_CLASS_BODY(InvTrigExpr, IUnaryExpression) public: explicit InvTrigExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/NotExpr.cpp b/src/fintamath/expressions/unary/NotExpr.cpp index b8ea00fe3..de6d2faf3 100644 --- a/src/fintamath/expressions/unary/NotExpr.cpp +++ b/src/fintamath/expressions/unary/NotExpr.cpp @@ -24,6 +24,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(NotExpr) + using namespace detail; NotExpr::NotExpr(ArgumentPtr inChild) diff --git a/src/fintamath/expressions/unary/NotExpr.hpp b/src/fintamath/expressions/unary/NotExpr.hpp index 1bbf58260..2e4eeccf8 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_CLASS_BODY(NotExpr, IUnaryExpression) public: explicit NotExpr(ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/SignExpr.cpp b/src/fintamath/expressions/unary/SignExpr.cpp index 8f9718b02..cae0c66ac 100644 --- a/src/fintamath/expressions/unary/SignExpr.cpp +++ b/src/fintamath/expressions/unary/SignExpr.cpp @@ -16,6 +16,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(SignExpr) + using namespace detail; SignExpr::SignExpr(ArgumentPtr inChild) diff --git a/src/fintamath/expressions/unary/SignExpr.hpp b/src/fintamath/expressions/unary/SignExpr.hpp index 839f1eea1..e6ea6b3d7 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_CLASS_BODY(SignExpr, IUnaryExpression) public: explicit SignExpr(ArgumentPtr inChild); diff --git a/src/fintamath/expressions/unary/TrigExpr.cpp b/src/fintamath/expressions/unary/TrigExpr.cpp index ff984dfc1..5e6032287 100644 --- a/src/fintamath/expressions/unary/TrigExpr.cpp +++ b/src/fintamath/expressions/unary/TrigExpr.cpp @@ -34,6 +34,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(TrigExpr) + using namespace detail; using NameToSimplifyFunctionMap = std::unordered_map>; diff --git a/src/fintamath/expressions/unary/TrigExpr.hpp b/src/fintamath/expressions/unary/TrigExpr.hpp index aee3ea448..c2be8700b 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_CLASS_BODY(TrigExpr, IUnaryExpression) public: explicit TrigExpr(const IFunction &inFunc, ArgumentPtr inChild); diff --git a/src/fintamath/functions/arithmetic/Abs.cpp b/src/fintamath/functions/arithmetic/Abs.cpp index 7168c53b1..9ef62e2a6 100644 --- a/src/fintamath/functions/arithmetic/Abs.cpp +++ b/src/fintamath/functions/arithmetic/Abs.cpp @@ -18,6 +18,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Abs) + using namespace detail; std::unique_ptr Abs::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/arithmetic/Add.cpp b/src/fintamath/functions/arithmetic/Add.cpp index f54ad3787..44c3ec854 100644 --- a/src/fintamath/functions/arithmetic/Add.cpp +++ b/src/fintamath/functions/arithmetic/Add.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Add) + std::unique_ptr Add::call(const ArgumentRefVector &argVect) const { auto res = cast(argVect.front().get().clone()); diff --git a/src/fintamath/functions/arithmetic/AddOper.cpp b/src/fintamath/functions/arithmetic/AddOper.cpp index 92e639c88..f34c5e470 100644 --- a/src/fintamath/functions/arithmetic/AddOper.cpp +++ b/src/fintamath/functions/arithmetic/AddOper.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(AddOper) + std::unique_ptr AddOper::call(const ArgumentRefVector &argVect) const { return Add{}(argVect); } diff --git a/src/fintamath/functions/arithmetic/Div.cpp b/src/fintamath/functions/arithmetic/Div.cpp index 781c78901..79242bf36 100644 --- a/src/fintamath/functions/arithmetic/Div.cpp +++ b/src/fintamath/functions/arithmetic/Div.cpp @@ -12,6 +12,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Div) + std::unique_ptr Div::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/arithmetic/Frac.cpp b/src/fintamath/functions/arithmetic/Frac.cpp index 5cdaf3512..e6353ade2 100644 --- a/src/fintamath/functions/arithmetic/Frac.cpp +++ b/src/fintamath/functions/arithmetic/Frac.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Frac) + std::unique_ptr Frac::call(const ArgumentRefVector &argVect) const { return Div{}(argVect); } diff --git a/src/fintamath/functions/arithmetic/FracMixed.cpp b/src/fintamath/functions/arithmetic/FracMixed.cpp index cb2b96fff..510a43ddd 100644 --- a/src/fintamath/functions/arithmetic/FracMixed.cpp +++ b/src/fintamath/functions/arithmetic/FracMixed.cpp @@ -11,6 +11,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(FracMixed) + std::unique_ptr FracMixed::call(const ArgumentRefVector &argVect) const { const auto &integ = cast(argVect[0].get()); const auto &numer = cast(argVect[1].get()); diff --git a/src/fintamath/functions/arithmetic/Mul.cpp b/src/fintamath/functions/arithmetic/Mul.cpp index bc3a2e045..53e8056f3 100644 --- a/src/fintamath/functions/arithmetic/Mul.cpp +++ b/src/fintamath/functions/arithmetic/Mul.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Mul) + std::unique_ptr Mul::call(const ArgumentRefVector &argVect) const { auto res = cast(argVect.front().get().clone()); diff --git a/src/fintamath/functions/arithmetic/MulOper.cpp b/src/fintamath/functions/arithmetic/MulOper.cpp index 251e9e449..4c7e1075b 100644 --- a/src/fintamath/functions/arithmetic/MulOper.cpp +++ b/src/fintamath/functions/arithmetic/MulOper.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(MulOper) + std::unique_ptr MulOper::call(const ArgumentRefVector &argVect) const { return Mul{}(argVect); } diff --git a/src/fintamath/functions/arithmetic/Neg.cpp b/src/fintamath/functions/arithmetic/Neg.cpp index e0fe071f6..92aa59523 100644 --- a/src/fintamath/functions/arithmetic/Neg.cpp +++ b/src/fintamath/functions/arithmetic/Neg.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Neg) + std::unique_ptr Neg::call(const ArgumentRefVector &argVect) const { const auto &rhs = cast(argVect.front().get()); diff --git a/src/fintamath/functions/arithmetic/Sign.cpp b/src/fintamath/functions/arithmetic/Sign.cpp index a72c57bb2..2a0d70bfb 100644 --- a/src/fintamath/functions/arithmetic/Sign.cpp +++ b/src/fintamath/functions/arithmetic/Sign.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sign) + using namespace detail; std::unique_ptr Sign::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/arithmetic/Sub.cpp b/src/fintamath/functions/arithmetic/Sub.cpp index 0130a8f8a..c950baa86 100644 --- a/src/fintamath/functions/arithmetic/Sub.cpp +++ b/src/fintamath/functions/arithmetic/Sub.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sub) + std::unique_ptr Sub::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/arithmetic/UnaryPlus.cpp b/src/fintamath/functions/arithmetic/UnaryPlus.cpp index 4c5b6171a..42e381d7b 100644 --- a/src/fintamath/functions/arithmetic/UnaryPlus.cpp +++ b/src/fintamath/functions/arithmetic/UnaryPlus.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(UnaryPlus) + std::unique_ptr UnaryPlus::call(const ArgumentRefVector &argVect) const { const auto &rhs = cast(argVect.front().get()); diff --git a/src/fintamath/functions/calculus/Derivative.cpp b/src/fintamath/functions/calculus/Derivative.cpp index fd45423f4..913fdf716 100644 --- a/src/fintamath/functions/calculus/Derivative.cpp +++ b/src/fintamath/functions/calculus/Derivative.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Derivative) + using namespace detail; std::unique_ptr Derivative::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/calculus/Integral.cpp b/src/fintamath/functions/calculus/Integral.cpp index 874a2f1ea..1a0654293 100644 --- a/src/fintamath/functions/calculus/Integral.cpp +++ b/src/fintamath/functions/calculus/Integral.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Integral) + using namespace detail; std::unique_ptr Integral::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/calculus/Max.cpp b/src/fintamath/functions/calculus/Max.cpp index 8c2e58574..25fdbdf01 100644 --- a/src/fintamath/functions/calculus/Max.cpp +++ b/src/fintamath/functions/calculus/Max.cpp @@ -12,6 +12,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Max) + std::unique_ptr Max::call(const ArgumentRefVector &argVect) const { std::reference_wrapper res = cast(argVect.front().get()); diff --git a/src/fintamath/functions/calculus/Min.cpp b/src/fintamath/functions/calculus/Min.cpp index a3bd2338a..747362f6d 100644 --- a/src/fintamath/functions/calculus/Min.cpp +++ b/src/fintamath/functions/calculus/Min.cpp @@ -12,6 +12,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Min) + std::unique_ptr Min::call(const ArgumentRefVector &argVect) const { std::reference_wrapper res = cast(argVect.front().get()); diff --git a/src/fintamath/functions/comparison/Eqv.cpp b/src/fintamath/functions/comparison/Eqv.cpp index c41122318..1fa617354 100644 --- a/src/fintamath/functions/comparison/Eqv.cpp +++ b/src/fintamath/functions/comparison/Eqv.cpp @@ -7,6 +7,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Eqv) + std::unique_ptr Eqv::call(const ArgumentRefVector &argVect) const { const auto &lhs = argVect.front().get(); const auto &rhs = argVect.back().get(); diff --git a/src/fintamath/functions/comparison/Less.cpp b/src/fintamath/functions/comparison/Less.cpp index 9c5db1334..15cf0c6fd 100644 --- a/src/fintamath/functions/comparison/Less.cpp +++ b/src/fintamath/functions/comparison/Less.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Less) + std::unique_ptr Less::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/comparison/LessEqv.cpp b/src/fintamath/functions/comparison/LessEqv.cpp index 70eef74ba..17e1e98a0 100644 --- a/src/fintamath/functions/comparison/LessEqv.cpp +++ b/src/fintamath/functions/comparison/LessEqv.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(LessEqv) + std::unique_ptr LessEqv::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/comparison/More.cpp b/src/fintamath/functions/comparison/More.cpp index be3171bdc..62cac2194 100644 --- a/src/fintamath/functions/comparison/More.cpp +++ b/src/fintamath/functions/comparison/More.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(More) + std::unique_ptr More::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/comparison/MoreEqv.cpp b/src/fintamath/functions/comparison/MoreEqv.cpp index f10d24663..e9dfc18ee 100644 --- a/src/fintamath/functions/comparison/MoreEqv.cpp +++ b/src/fintamath/functions/comparison/MoreEqv.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(MoreEqv) + std::unique_ptr MoreEqv::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/comparison/Neqv.cpp b/src/fintamath/functions/comparison/Neqv.cpp index fe9b9b83e..358667528 100644 --- a/src/fintamath/functions/comparison/Neqv.cpp +++ b/src/fintamath/functions/comparison/Neqv.cpp @@ -7,6 +7,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Neqv) + std::unique_ptr Neqv::call(const ArgumentRefVector &argVect) const { const auto &lhs = argVect.front().get(); const auto &rhs = argVect.back().get(); diff --git a/src/fintamath/functions/hyperbolic/Acosh.cpp b/src/fintamath/functions/hyperbolic/Acosh.cpp index 52d5f6df6..18921c892 100644 --- a/src/fintamath/functions/hyperbolic/Acosh.cpp +++ b/src/fintamath/functions/hyperbolic/Acosh.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Acosh) + using namespace detail; std::unique_ptr Acosh::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Acoth.cpp b/src/fintamath/functions/hyperbolic/Acoth.cpp index a551a1ea9..81ca2b36b 100644 --- a/src/fintamath/functions/hyperbolic/Acoth.cpp +++ b/src/fintamath/functions/hyperbolic/Acoth.cpp @@ -17,6 +17,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Acoth) + using namespace detail; std::unique_ptr Acoth::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Acsch.cpp b/src/fintamath/functions/hyperbolic/Acsch.cpp index b65e43e0c..24b81a25f 100644 --- a/src/fintamath/functions/hyperbolic/Acsch.cpp +++ b/src/fintamath/functions/hyperbolic/Acsch.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Acsch) + using namespace detail; std::unique_ptr Acsch::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Asech.cpp b/src/fintamath/functions/hyperbolic/Asech.cpp index 48f450a88..ecb73bb55 100644 --- a/src/fintamath/functions/hyperbolic/Asech.cpp +++ b/src/fintamath/functions/hyperbolic/Asech.cpp @@ -17,6 +17,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Asech) + using namespace detail; std::unique_ptr Asech::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Asinh.cpp b/src/fintamath/functions/hyperbolic/Asinh.cpp index f39405772..8e5defd7d 100644 --- a/src/fintamath/functions/hyperbolic/Asinh.cpp +++ b/src/fintamath/functions/hyperbolic/Asinh.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Asinh) + using namespace detail; std::unique_ptr Asinh::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Atanh.cpp b/src/fintamath/functions/hyperbolic/Atanh.cpp index 6736b4231..4e4ad5734 100644 --- a/src/fintamath/functions/hyperbolic/Atanh.cpp +++ b/src/fintamath/functions/hyperbolic/Atanh.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Atanh) + using namespace detail; std::unique_ptr Atanh::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Cosh.cpp b/src/fintamath/functions/hyperbolic/Cosh.cpp index 80c7eaa49..192b57f7e 100644 --- a/src/fintamath/functions/hyperbolic/Cosh.cpp +++ b/src/fintamath/functions/hyperbolic/Cosh.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Cosh) + using namespace detail; std::unique_ptr Cosh::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Coth.cpp b/src/fintamath/functions/hyperbolic/Coth.cpp index a8cbd13d1..89c6eb1d1 100644 --- a/src/fintamath/functions/hyperbolic/Coth.cpp +++ b/src/fintamath/functions/hyperbolic/Coth.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Coth) + using namespace detail; std::unique_ptr Coth::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Csch.cpp b/src/fintamath/functions/hyperbolic/Csch.cpp index c79cdcff2..a789f3bcc 100644 --- a/src/fintamath/functions/hyperbolic/Csch.cpp +++ b/src/fintamath/functions/hyperbolic/Csch.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Csch) + using namespace detail; std::unique_ptr Csch::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Sech.cpp b/src/fintamath/functions/hyperbolic/Sech.cpp index cb28608ef..3aeee1cd8 100644 --- a/src/fintamath/functions/hyperbolic/Sech.cpp +++ b/src/fintamath/functions/hyperbolic/Sech.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sech) + using namespace detail; std::unique_ptr Sech::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Sinh.cpp b/src/fintamath/functions/hyperbolic/Sinh.cpp index e4305e38c..1ab7df086 100644 --- a/src/fintamath/functions/hyperbolic/Sinh.cpp +++ b/src/fintamath/functions/hyperbolic/Sinh.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sinh) + using namespace detail; std::unique_ptr Sinh::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/hyperbolic/Tanh.cpp b/src/fintamath/functions/hyperbolic/Tanh.cpp index 2b96695e9..93d6679e2 100644 --- a/src/fintamath/functions/hyperbolic/Tanh.cpp +++ b/src/fintamath/functions/hyperbolic/Tanh.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Tanh) + using namespace detail; std::unique_ptr Tanh::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/logarithms/Lb.cpp b/src/fintamath/functions/logarithms/Lb.cpp index 41012862b..aa199a713 100644 --- a/src/fintamath/functions/logarithms/Lb.cpp +++ b/src/fintamath/functions/logarithms/Lb.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Lb) + std::unique_ptr Lb::call(const ArgumentRefVector &argVect) const { static const Integer lhs = 2; const auto &rhs = argVect.front().get(); diff --git a/src/fintamath/functions/logarithms/Lg.cpp b/src/fintamath/functions/logarithms/Lg.cpp index 69becfed4..188f4207d 100644 --- a/src/fintamath/functions/logarithms/Lg.cpp +++ b/src/fintamath/functions/logarithms/Lg.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Lg) + std::unique_ptr Lg::call(const ArgumentRefVector &argVect) const { static const Integer lhs = 10; const auto &rhs = argVect.front().get(); diff --git a/src/fintamath/functions/logarithms/Ln.cpp b/src/fintamath/functions/logarithms/Ln.cpp index fff09c50d..b4e75f8f3 100644 --- a/src/fintamath/functions/logarithms/Ln.cpp +++ b/src/fintamath/functions/logarithms/Ln.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Ln) + using namespace detail; std::unique_ptr Ln::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/logarithms/Log.cpp b/src/fintamath/functions/logarithms/Log.cpp index 70fdfcada..2c7fb4370 100644 --- a/src/fintamath/functions/logarithms/Log.cpp +++ b/src/fintamath/functions/logarithms/Log.cpp @@ -21,6 +21,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Log) + using namespace detail; std::unique_ptr Log::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/logic/And.cpp b/src/fintamath/functions/logic/And.cpp index c9e63d230..9cdcb753c 100644 --- a/src/fintamath/functions/logic/And.cpp +++ b/src/fintamath/functions/logic/And.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(And) + std::unique_ptr And::call(const ArgumentRefVector &argVect) const { auto res = cast(argVect.front().get()); diff --git a/src/fintamath/functions/logic/AndOper.cpp b/src/fintamath/functions/logic/AndOper.cpp index a3672043d..decda7e75 100644 --- a/src/fintamath/functions/logic/AndOper.cpp +++ b/src/fintamath/functions/logic/AndOper.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(AndOper) + std::unique_ptr AndOper::call(const ArgumentRefVector &argVect) const { return And{}(argVect); } diff --git a/src/fintamath/functions/logic/Equiv.cpp b/src/fintamath/functions/logic/Equiv.cpp index b2fdda2f5..0ec7db9df 100644 --- a/src/fintamath/functions/logic/Equiv.cpp +++ b/src/fintamath/functions/logic/Equiv.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Equiv) + std::unique_ptr Equiv::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/logic/Impl.cpp b/src/fintamath/functions/logic/Impl.cpp index b17544217..b4f4a8f13 100644 --- a/src/fintamath/functions/logic/Impl.cpp +++ b/src/fintamath/functions/logic/Impl.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Impl) + std::unique_ptr Impl::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/logic/Nequiv.cpp b/src/fintamath/functions/logic/Nequiv.cpp index 4fbf419a1..c9749b72e 100644 --- a/src/fintamath/functions/logic/Nequiv.cpp +++ b/src/fintamath/functions/logic/Nequiv.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Nequiv) + std::unique_ptr Nequiv::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/logic/Not.cpp b/src/fintamath/functions/logic/Not.cpp index b60dd2aae..73991586c 100644 --- a/src/fintamath/functions/logic/Not.cpp +++ b/src/fintamath/functions/logic/Not.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Not) + std::unique_ptr Not::call(const ArgumentRefVector &argVect) const { const auto &rhs = cast(argVect.front().get()); diff --git a/src/fintamath/functions/logic/Or.cpp b/src/fintamath/functions/logic/Or.cpp index c4f3bccfc..d5fbd1ea2 100644 --- a/src/fintamath/functions/logic/Or.cpp +++ b/src/fintamath/functions/logic/Or.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Or) + std::unique_ptr Or::call(const ArgumentRefVector &argVect) const { auto res = cast(argVect.front().get()); diff --git a/src/fintamath/functions/logic/OrOper.cpp b/src/fintamath/functions/logic/OrOper.cpp index df3f81766..a8e076c8b 100644 --- a/src/fintamath/functions/logic/OrOper.cpp +++ b/src/fintamath/functions/logic/OrOper.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(OrOper) + std::unique_ptr OrOper::call(const ArgumentRefVector &argVect) const { return Or{}(argVect); } diff --git a/src/fintamath/functions/ntheory/Ceil.cpp b/src/fintamath/functions/ntheory/Ceil.cpp index 10633dc20..17cf98501 100644 --- a/src/fintamath/functions/ntheory/Ceil.cpp +++ b/src/fintamath/functions/ntheory/Ceil.cpp @@ -18,6 +18,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Ceil) + using namespace detail; std::unique_ptr Ceil::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/ntheory/Floor.cpp b/src/fintamath/functions/ntheory/Floor.cpp index 0262251fe..93af1aa48 100644 --- a/src/fintamath/functions/ntheory/Floor.cpp +++ b/src/fintamath/functions/ntheory/Floor.cpp @@ -18,6 +18,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Floor) + using namespace detail; std::unique_ptr Floor::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/ntheory/Mod.cpp b/src/fintamath/functions/ntheory/Mod.cpp index a7fe4b7fe..8f925335b 100644 --- a/src/fintamath/functions/ntheory/Mod.cpp +++ b/src/fintamath/functions/ntheory/Mod.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Mod) + using namespace detail; std::unique_ptr Mod::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/other/Comma.cpp b/src/fintamath/functions/other/Comma.cpp index e4f08173b..5c277c80e 100644 --- a/src/fintamath/functions/other/Comma.cpp +++ b/src/fintamath/functions/other/Comma.cpp @@ -7,6 +7,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Comma) + std::unique_ptr Comma::call(const ArgumentRefVector &argVect) const { const auto &lhs = argVect.front().get(); const auto &rhs = argVect.back().get(); diff --git a/src/fintamath/functions/other/Deg.cpp b/src/fintamath/functions/other/Deg.cpp index 941ed3d29..1b32224ea 100644 --- a/src/fintamath/functions/other/Deg.cpp +++ b/src/fintamath/functions/other/Deg.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Deg) + std::unique_ptr Deg::call(const ArgumentRefVector &argVect) const { static const ArgumentPtr degVal = divExpr(Pi{}, Integer(180)); const auto &rhs = argVect.front().get(); diff --git a/src/fintamath/functions/other/Factorial.cpp b/src/fintamath/functions/other/Factorial.cpp index dcd6e06db..f8bb972b3 100644 --- a/src/fintamath/functions/other/Factorial.cpp +++ b/src/fintamath/functions/other/Factorial.cpp @@ -16,6 +16,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Factorial) + using namespace detail; std::unique_ptr Factorial::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/other/Index.cpp b/src/fintamath/functions/other/Index.cpp index eddb24652..063f8c2d9 100644 --- a/src/fintamath/functions/other/Index.cpp +++ b/src/fintamath/functions/other/Index.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Index) + std::unique_ptr Index::call(const ArgumentRefVector &argVect) const { const auto &lhs = cast(argVect.front().get()); const auto &rhs = cast(argVect.back().get()); diff --git a/src/fintamath/functions/other/Percent.cpp b/src/fintamath/functions/other/Percent.cpp index c2c865b09..3628e9ca4 100644 --- a/src/fintamath/functions/other/Percent.cpp +++ b/src/fintamath/functions/other/Percent.cpp @@ -10,6 +10,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Percent) + std::unique_ptr Percent::call(const ArgumentRefVector &argVect) const { static const Rational percentVal = 100; const auto &rhs = cast(argVect.front().get()); diff --git a/src/fintamath/functions/powers/Exp.cpp b/src/fintamath/functions/powers/Exp.cpp index ae09ccde1..ea73e3cea 100644 --- a/src/fintamath/functions/powers/Exp.cpp +++ b/src/fintamath/functions/powers/Exp.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Exp) + std::unique_ptr Exp::call(const ArgumentRefVector &argVect) const { static const E lhs; const auto &rhs = argVect.front().get(); diff --git a/src/fintamath/functions/powers/Pow.cpp b/src/fintamath/functions/powers/Pow.cpp index d037e6e92..896caf7fe 100644 --- a/src/fintamath/functions/powers/Pow.cpp +++ b/src/fintamath/functions/powers/Pow.cpp @@ -20,6 +20,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Pow) + using namespace detail; std::unique_ptr Pow::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/powers/PowOper.cpp b/src/fintamath/functions/powers/PowOper.cpp index 89cab9859..958382a86 100644 --- a/src/fintamath/functions/powers/PowOper.cpp +++ b/src/fintamath/functions/powers/PowOper.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(PowOper) + std::unique_ptr PowOper::call(const ArgumentRefVector &argVect) const { return Pow{}(argVect); } diff --git a/src/fintamath/functions/powers/Root.cpp b/src/fintamath/functions/powers/Root.cpp index 6469d4d8e..5a4096a0d 100644 --- a/src/fintamath/functions/powers/Root.cpp +++ b/src/fintamath/functions/powers/Root.cpp @@ -17,6 +17,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Root) + using namespace detail; std::unique_ptr Root::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/powers/Sqr.cpp b/src/fintamath/functions/powers/Sqr.cpp index 827be61de..471f6c1ff 100644 --- a/src/fintamath/functions/powers/Sqr.cpp +++ b/src/fintamath/functions/powers/Sqr.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sqr) + std::unique_ptr Sqr::call(const ArgumentRefVector &argVect) const { const auto &lhs = argVect.front().get(); static const Integer rhs = 2; diff --git a/src/fintamath/functions/powers/Sqrt.cpp b/src/fintamath/functions/powers/Sqrt.cpp index 150418af5..feb921908 100644 --- a/src/fintamath/functions/powers/Sqrt.cpp +++ b/src/fintamath/functions/powers/Sqrt.cpp @@ -9,6 +9,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sqrt) + std::unique_ptr Sqrt::call(const ArgumentRefVector &argVect) const { const auto &lhs = argVect.front().get(); static const Integer rhs = 2; diff --git a/src/fintamath/functions/trigonometry/Acos.cpp b/src/fintamath/functions/trigonometry/Acos.cpp index a34490002..3d8b0e604 100644 --- a/src/fintamath/functions/trigonometry/Acos.cpp +++ b/src/fintamath/functions/trigonometry/Acos.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Acos) + using namespace detail; std::unique_ptr Acos::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Acot.cpp b/src/fintamath/functions/trigonometry/Acot.cpp index 4e864cf8f..78cdcbef6 100644 --- a/src/fintamath/functions/trigonometry/Acot.cpp +++ b/src/fintamath/functions/trigonometry/Acot.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Acot) + using namespace detail; std::unique_ptr Acot::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Acsc.cpp b/src/fintamath/functions/trigonometry/Acsc.cpp index 06795f9b2..4fb0da835 100644 --- a/src/fintamath/functions/trigonometry/Acsc.cpp +++ b/src/fintamath/functions/trigonometry/Acsc.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Acsc) + using namespace detail; std::unique_ptr Acsc::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Asec.cpp b/src/fintamath/functions/trigonometry/Asec.cpp index 06daaa365..3187d8ea6 100644 --- a/src/fintamath/functions/trigonometry/Asec.cpp +++ b/src/fintamath/functions/trigonometry/Asec.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Asec) + using namespace detail; std::unique_ptr Asec::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Asin.cpp b/src/fintamath/functions/trigonometry/Asin.cpp index ca7819d26..00dea24a4 100644 --- a/src/fintamath/functions/trigonometry/Asin.cpp +++ b/src/fintamath/functions/trigonometry/Asin.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Asin) + using namespace detail; std::unique_ptr Asin::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Atan.cpp b/src/fintamath/functions/trigonometry/Atan.cpp index d998d6085..850afeca7 100644 --- a/src/fintamath/functions/trigonometry/Atan.cpp +++ b/src/fintamath/functions/trigonometry/Atan.cpp @@ -15,6 +15,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Atan) + using namespace detail; std::unique_ptr Atan::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Cos.cpp b/src/fintamath/functions/trigonometry/Cos.cpp index 0b82f36a1..0dfd30e3d 100644 --- a/src/fintamath/functions/trigonometry/Cos.cpp +++ b/src/fintamath/functions/trigonometry/Cos.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Cos) + using namespace detail; std::unique_ptr Cos::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Cot.cpp b/src/fintamath/functions/trigonometry/Cot.cpp index ed27a0474..16653ee47 100644 --- a/src/fintamath/functions/trigonometry/Cot.cpp +++ b/src/fintamath/functions/trigonometry/Cot.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Cot) + using namespace detail; std::unique_ptr Cot::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Csc.cpp b/src/fintamath/functions/trigonometry/Csc.cpp index 9d8a14cca..d81c821a5 100644 --- a/src/fintamath/functions/trigonometry/Csc.cpp +++ b/src/fintamath/functions/trigonometry/Csc.cpp @@ -14,6 +14,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Csc) + using namespace detail; std::unique_ptr Csc::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Sec.cpp b/src/fintamath/functions/trigonometry/Sec.cpp index 51c25fd72..806d6d7bc 100644 --- a/src/fintamath/functions/trigonometry/Sec.cpp +++ b/src/fintamath/functions/trigonometry/Sec.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sec) + using namespace detail; std::unique_ptr Sec::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Sin.cpp b/src/fintamath/functions/trigonometry/Sin.cpp index 908c4abf2..84489d6bd 100644 --- a/src/fintamath/functions/trigonometry/Sin.cpp +++ b/src/fintamath/functions/trigonometry/Sin.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Sin) + using namespace detail; std::unique_ptr Sin::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/functions/trigonometry/Tan.cpp b/src/fintamath/functions/trigonometry/Tan.cpp index 3088a4f0a..40fb0f501 100644 --- a/src/fintamath/functions/trigonometry/Tan.cpp +++ b/src/fintamath/functions/trigonometry/Tan.cpp @@ -13,6 +13,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Tan) + using namespace detail; std::unique_ptr Tan::call(const ArgumentRefVector &argVect) const { diff --git a/src/fintamath/literals/Boolean.cpp b/src/fintamath/literals/Boolean.cpp index eef68b3d7..3b4869cc3 100644 --- a/src/fintamath/literals/Boolean.cpp +++ b/src/fintamath/literals/Boolean.cpp @@ -4,6 +4,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Boolean) + Boolean::Boolean() : name(falseStr) { } diff --git a/src/fintamath/literals/Variable.cpp b/src/fintamath/literals/Variable.cpp index b4d46934a..4de6f9071 100644 --- a/src/fintamath/literals/Variable.cpp +++ b/src/fintamath/literals/Variable.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Variable) + Variable::Variable(std::string inName) { if (inName.size() != 1) { throw InvalidInputException(inName); diff --git a/src/fintamath/literals/constants/ComplexInf.cpp b/src/fintamath/literals/constants/ComplexInf.cpp index f338d1ddd..2a748a027 100644 --- a/src/fintamath/literals/constants/ComplexInf.cpp +++ b/src/fintamath/literals/constants/ComplexInf.cpp @@ -6,6 +6,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(ComplexInf) + std::unique_ptr ComplexInf::call() const { return clone(); } diff --git a/src/fintamath/literals/constants/E.cpp b/src/fintamath/literals/constants/E.cpp index 6eb30a2b5..ffb99ae10 100644 --- a/src/fintamath/literals/constants/E.cpp +++ b/src/fintamath/literals/constants/E.cpp @@ -7,6 +7,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(E) + std::unique_ptr E::call() const { return getE().clone(); } diff --git a/src/fintamath/literals/constants/False.cpp b/src/fintamath/literals/constants/False.cpp index aed7b1784..25346f3b2 100644 --- a/src/fintamath/literals/constants/False.cpp +++ b/src/fintamath/literals/constants/False.cpp @@ -6,6 +6,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(False) + std::unique_ptr False::call() const { return Boolean(false).clone(); } diff --git a/src/fintamath/literals/constants/I.cpp b/src/fintamath/literals/constants/I.cpp index 5166a695b..d6f8d9bd7 100644 --- a/src/fintamath/literals/constants/I.cpp +++ b/src/fintamath/literals/constants/I.cpp @@ -8,6 +8,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(I) + std::unique_ptr I::call() const { return std::make_unique(Integer(0), Integer(1)); } diff --git a/src/fintamath/literals/constants/Inf.cpp b/src/fintamath/literals/constants/Inf.cpp index ac740c54f..8942790e3 100644 --- a/src/fintamath/literals/constants/Inf.cpp +++ b/src/fintamath/literals/constants/Inf.cpp @@ -6,6 +6,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Inf) + std::unique_ptr Inf::call() const { return clone(); } diff --git a/src/fintamath/literals/constants/NegInf.cpp b/src/fintamath/literals/constants/NegInf.cpp index 22f58e239..794dbcf47 100644 --- a/src/fintamath/literals/constants/NegInf.cpp +++ b/src/fintamath/literals/constants/NegInf.cpp @@ -6,6 +6,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(NegInf) + std::unique_ptr NegInf::call() const { return clone(); } diff --git a/src/fintamath/literals/constants/Pi.cpp b/src/fintamath/literals/constants/Pi.cpp index 990acec03..046fedc8a 100644 --- a/src/fintamath/literals/constants/Pi.cpp +++ b/src/fintamath/literals/constants/Pi.cpp @@ -7,6 +7,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Pi) + std::unique_ptr Pi::call() const { return getPi().clone(); } diff --git a/src/fintamath/literals/constants/True.cpp b/src/fintamath/literals/constants/True.cpp index 027f6d204..76b1ff851 100644 --- a/src/fintamath/literals/constants/True.cpp +++ b/src/fintamath/literals/constants/True.cpp @@ -6,6 +6,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(True) + std::unique_ptr True::call() const { return Boolean(true).clone(); } diff --git a/src/fintamath/literals/constants/Undefined.cpp b/src/fintamath/literals/constants/Undefined.cpp index 385939e6c..578c9fd69 100644 --- a/src/fintamath/literals/constants/Undefined.cpp +++ b/src/fintamath/literals/constants/Undefined.cpp @@ -6,6 +6,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Undefined) + std::unique_ptr Undefined::call() const { return clone(); } diff --git a/src/fintamath/numbers/Complex.cpp b/src/fintamath/numbers/Complex.cpp index 3c7829c4c..836362855 100644 --- a/src/fintamath/numbers/Complex.cpp +++ b/src/fintamath/numbers/Complex.cpp @@ -17,6 +17,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Complex) + Complex::Complex(const Complex &rhs) : re(cast(rhs.re->clone())), im(cast(rhs.im->clone())) { } diff --git a/src/fintamath/numbers/Integer.cpp b/src/fintamath/numbers/Integer.cpp index 6caffe5bf..042c244eb 100644 --- a/src/fintamath/numbers/Integer.cpp +++ b/src/fintamath/numbers/Integer.cpp @@ -12,6 +12,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Integer) + using namespace detail; Integer::Integer(Backend inBackend) : backend(std::move(inBackend)) { diff --git a/src/fintamath/numbers/Rational.cpp b/src/fintamath/numbers/Rational.cpp index 7d513a96a..409f22186 100644 --- a/src/fintamath/numbers/Rational.cpp +++ b/src/fintamath/numbers/Rational.cpp @@ -17,6 +17,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Rational) + Rational::Rational(const std::string &str) { if (str.empty()) { throw InvalidInputException(str); diff --git a/src/fintamath/numbers/Real.cpp b/src/fintamath/numbers/Real.cpp index 165735ed3..9774c6cba 100644 --- a/src/fintamath/numbers/Real.cpp +++ b/src/fintamath/numbers/Real.cpp @@ -19,6 +19,8 @@ namespace fintamath { +FINTAMATH_CLASS_IMPLEMENTATION(Real) + using namespace detail; constexpr unsigned precisionMultiplier = 2; diff --git a/tests/src/core/IArithmeticTests.cpp b/tests/src/core/IArithmeticTests.cpp index 7f7b948ca..092501e6f 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_CLASS_BODY(TestArithmetic, IArithmetic) protected: TestArithmetic &add(const TestArithmetic & /* rhs */) override { @@ -36,6 +36,8 @@ class TestArithmetic final : public IArithmeticCRTP { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestArithmetic) + [[maybe_unused]] const auto config = [] { IArithmetic::registerType(); return 0; @@ -206,6 +208,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..5631f136e 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_CLASS_BODY(TestComparable, IComparable) protected: std::strong_ordering compare(const TestComparable & /* rhs */) const override { @@ -39,6 +39,8 @@ class TestComparable final : public IComparableCRTP { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestComparable) + [[maybe_unused]] const auto config = [] { IComparable::registerType(); return 0; @@ -151,6 +153,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..ea719663b 100644 --- a/tests/src/core/IMathObjectTests.cpp +++ b/tests/src/core/IMathObjectTests.cpp @@ -11,10 +11,12 @@ using namespace fintamath; namespace { -class TestMathObject final : public IMathObjectCRTP { - FINTAMATH_CLASS_BODY(TestMathObject) +class TestMathObject : public IMathObjectCRTP { + FINTAMATH_CLASS_BODY(TestMathObject, IMathObject) }; +FINTAMATH_CLASS_IMPLEMENTATION(TestMathObject) + [[maybe_unused]] const auto config = [] { IMathObject::registerType(); return 0; @@ -110,9 +112,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..7a962ce6a 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,39 +9,47 @@ 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) }; +FINTAMATH_CLASS_IMPLEMENTATION(ChildTest1) + class ChildTest2 : public IParentTest1 { - FINTAMATH_CLASS_BODY(ChildTest2) + FINTAMATH_CLASS_BODY(ChildTest2, IParentTest1) }; +FINTAMATH_CLASS_IMPLEMENTATION(ChildTest2) + class ChildTest3 : public IParentTest2 { - FINTAMATH_CLASS_BODY(ChildTest3) + FINTAMATH_CLASS_BODY(ChildTest3, IParentTest2) }; +FINTAMATH_CLASS_IMPLEMENTATION(ChildTest3) + class OtherChildTest : public IParentTest2 { - FINTAMATH_CLASS_BODY(OtherChildTest) + FINTAMATH_CLASS_BODY(OtherChildTest, IParentTest2) }; +FINTAMATH_CLASS_IMPLEMENTATION(OtherChildTest) + [[maybe_unused]] const auto config = [] { ISuperParentTest::registerType(); IParentTest1::registerType(); @@ -54,79 +63,34 @@ class OtherChildTest : public IParentTest2 { TEST(MathObjectClassTests, constructorTest) { { - constexpr MathObjectClass t("Test"); + constexpr MathObjectClassImpl t("Test"); EXPECT_EQ(t.getName(), "Test"); + EXPECT_FALSE(t.getParent()); } { - 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_EQ(ISuperParentTest::getClassStatic().getChildren().size(), 2); - - 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_FALSE(MathObjectClassImpl("Test").getParent()); - EXPECT_EQ(ISuperParentTest::getClassStatic().getChildren(true).size(), 5); + EXPECT_FALSE(ISuperParentTest::getClassStatic()->getParent()); - 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..830b92254 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_CLASS_BODY(TestUnaryFunction, IFunction) public: std::string toString() const override { @@ -23,8 +23,10 @@ class TestUnaryFunction final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(TestBinaryFunction) +FINTAMATH_CLASS_IMPLEMENTATION(TestUnaryFunction) + +class TestBinaryFunction : public IFunctionCRTP { + FINTAMATH_CLASS_BODY(TestBinaryFunction, IFunction) public: std::string toString() const override { @@ -37,8 +39,10 @@ class TestBinaryFunction final : public IFunctionCRTP { - FINTAMATH_CLASS_BODY(TestBinaryOperator) +FINTAMATH_CLASS_IMPLEMENTATION(TestBinaryFunction) + +class TestBinaryOperator : public IOperatorCRTP { + FINTAMATH_CLASS_BODY(TestBinaryOperator, IOperator) public: std::string toString() const override { @@ -55,8 +59,10 @@ class TestBinaryOperator final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(TestUnaryPrefixOperator) +FINTAMATH_CLASS_IMPLEMENTATION(TestBinaryOperator) + +class TestUnaryPrefixOperator : public IOperatorCRTP { + FINTAMATH_CLASS_BODY(TestUnaryPrefixOperator, IOperator) public: std::string toString() const override { @@ -73,8 +79,10 @@ class TestUnaryPrefixOperator final : public IOperatorCRTP { - FINTAMATH_CLASS_BODY(TestUnaryPostfixOperator) +FINTAMATH_CLASS_IMPLEMENTATION(TestUnaryPrefixOperator) + +class TestUnaryPostfixOperator : public IOperatorCRTP { + FINTAMATH_CLASS_BODY(TestUnaryPostfixOperator, IOperator) public: std::string toString() const override { @@ -91,6 +99,8 @@ class TestUnaryPostfixOperator final : public IOperatorCRTP(); IFunction::registerType(); @@ -127,6 +137,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..b49aac62f 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_CLASS_BODY(TestExpression, IExpression) public: const std::shared_ptr &getFunction() const override { @@ -47,6 +47,8 @@ class TestExpression final : public IExpressionCRTP { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestExpression) + [[maybe_unused]] const auto config = [] { IExpression::registerType(); return 0; @@ -103,6 +105,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..69cac65ee 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_CLASS_BODY(TestBinaryExpression, IBinaryExpression) public: explicit TestBinaryExpression(ArgumentPtr inLhsChild, ArgumentPtr inRhsChild) @@ -19,6 +19,8 @@ class TestBinaryExpression final : public IBinaryExpressionCRTP(); return 0; @@ -71,6 +73,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..afcaf8b66 100644 --- a/tests/src/expressions/interfaces/IPolynomExpressionTests.cpp +++ b/tests/src/expressions/interfaces/IPolynomExpressionTests.cpp @@ -12,14 +12,16 @@ const Mul f; namespace { -class TestPolynomExpression final : public IPolynomExpressionCRTP { - FINTAMATH_CLASS_BODY(TestPolynomExpression) +class TestPolynomExpression : public IPolynomExpressionCRTP { + FINTAMATH_CLASS_BODY(TestPolynomExpression, IPolynomExpression) public: explicit TestPolynomExpression(ArgumentPtrVector args) : IPolynomExpressionCRTP(f, std::move(args)) { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestPolynomExpression) + [[maybe_unused]] const auto config = [] { IPolynomExpression::registerType(); return 0; @@ -79,6 +81,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..9816a017a 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_CLASS_BODY(TestUnaryExpression, IUnaryExpression) public: explicit TestUnaryExpression(ArgumentPtr inRhsChild) @@ -19,6 +19,8 @@ class TestUnaryExpression final : public IUnaryExpressionCRTP(); return 0; @@ -70,6 +72,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..5e0a60c1b 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_CLASS_BODY(TestFunction, IFunction) protected: std::unique_ptr call(const ArgumentRefVector &argVect) const override { @@ -26,6 +26,8 @@ class TestFunction final : public IFunctionCRTP } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestFunction) + [[maybe_unused]] const auto config = [] { IFunction::registerType(); return 0; @@ -128,6 +130,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..7b7962006 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_CLASS_BODY(TestOperator, IOperator) public: static constexpr Priority getPriorityStatic() { @@ -27,6 +27,8 @@ class TestOperator final : public IOperatorCRTP } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestOperator) + [[maybe_unused]] const auto config = [] { IOperator::registerType(); return 0; @@ -53,6 +55,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..55c78aa93 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_CLASS_BODY(TestComparable, IComparable) public: std::string toString() const override { @@ -48,6 +48,8 @@ class TestComparable final : public IComparableCRTP { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestComparable) + [[maybe_unused]] const auto config = [] { IComparable::registerType(); return 0; @@ -97,6 +99,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..cedb1aa1c 100644 --- a/tests/src/literals/ILiteralTests.cpp +++ b/tests/src/literals/ILiteralTests.cpp @@ -10,10 +10,12 @@ using namespace fintamath; namespace { -class TestLiteral final : public ILiteralCRTP { - FINTAMATH_CLASS_BODY(TestLiteral) +class TestLiteral : public ILiteralCRTP { + FINTAMATH_CLASS_BODY(TestLiteral, ILiteral) }; +FINTAMATH_CLASS_IMPLEMENTATION(TestLiteral) + [[maybe_unused]] const auto config = [] { ILiteral::registerType(); return 0; @@ -46,6 +48,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..1caa16777 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_CLASS_BODY(TestConstant, IConstant) protected: std::unique_ptr call() const override { @@ -18,6 +18,8 @@ class TestConstant final : public IConstantCRTP { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestConstant) + [[maybe_unused]] const auto config = [] { IConstant::registerType(); return 0; @@ -38,6 +40,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..5588245c3 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_CLASS_BODY(TestNumber, INumber) protected: TestNumber &add(const TestNumber &rhs) override { @@ -38,6 +38,8 @@ class TestNumber final : public INumberCRTP { } }; +FINTAMATH_CLASS_IMPLEMENTATION(TestNumber) + [[maybe_unused]] const auto config = [] { INumber::registerType(); return 0; @@ -129,6 +131,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) {