-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MathObjectClass, new Parser, class body macro
- Loading branch information
Showing
354 changed files
with
2,063 additions
and
2,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "fintamath/core/MathObjectClass.hpp" | ||
#include "fintamath/core/Parser.hpp" | ||
|
||
#define FINTAMATH_CLASS_BODY(Class) \ | ||
public: \ | ||
static constexpr MathObjectClass getClassStatic() { \ | ||
return {#Class}; \ | ||
} \ | ||
\ | ||
private: | ||
|
||
#define FINTAMATH_PARENT_CLASS_BODY(Class) \ | ||
FINTAMATH_CLASS_BODY(Class) \ | ||
\ | ||
private: \ | ||
using Class##Parser = detail::Parser<std::unique_ptr<Class>()>; \ | ||
\ | ||
static auto &getParser() { \ | ||
static Class##Parser parser; \ | ||
return parser; \ | ||
} \ | ||
\ | ||
public: \ | ||
static auto parse(const std::string &str) { \ | ||
return getParser().parse(str); \ | ||
} \ | ||
\ | ||
static auto parseFirst(const std::string &str) { \ | ||
return getParser().parseFirst(str); \ | ||
} \ | ||
\ | ||
template <std::derived_from<Class> T> \ | ||
static void registerType() { \ | ||
MathObjectClass::bindTypes<Class, T>(); \ | ||
getParser().registerType<T>(); \ | ||
} \ | ||
\ | ||
private: |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.