simplify blueprint implementation with helpers
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
7acda2852f
commit
0496ea7259
6 changed files with 200 additions and 218 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#include "function_context.hpp"
|
||||
|
||||
FunctionContext::FunctionContext(IkarusProject * project):
|
||||
IkarusFunctionContext::IkarusFunctionContext(IkarusProject * project):
|
||||
_project{project} {}
|
||||
|
||||
FunctionContext::~FunctionContext() {
|
||||
IkarusFunctionContext::~IkarusFunctionContext() {
|
||||
if (_project->_function_contexts.size() == 1) {
|
||||
if (_project->error_message_buffer.empty()) {
|
||||
_project->error_message_buffer.push_back('\0');
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@
|
|||
|
||||
#include <persistence/project.hpp>
|
||||
|
||||
struct FunctionContext {
|
||||
struct IkarusFunctionContext {
|
||||
public:
|
||||
explicit FunctionContext(struct IkarusProject * project);
|
||||
explicit IkarusFunctionContext(struct IkarusProject * project);
|
||||
|
||||
FunctionContext(FunctionContext const&) noexcept = default;
|
||||
FunctionContext(FunctionContext&&) noexcept = default;
|
||||
IkarusFunctionContext(IkarusFunctionContext const&) noexcept = default;
|
||||
IkarusFunctionContext(IkarusFunctionContext&&) noexcept = default;
|
||||
|
||||
auto operator=(FunctionContext const&) noexcept -> FunctionContext& = default;
|
||||
auto operator=(FunctionContext&&) noexcept -> FunctionContext& = default;
|
||||
auto operator=(IkarusFunctionContext const&) noexcept -> IkarusFunctionContext& = default;
|
||||
auto operator=(IkarusFunctionContext&&) noexcept -> IkarusFunctionContext& = default;
|
||||
|
||||
~FunctionContext();
|
||||
~IkarusFunctionContext();
|
||||
|
||||
public:
|
||||
template<typename... Infos>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ auto IkarusProject::get_db() const -> sqlitecpp::Connection const * {
|
|||
return _db.get();
|
||||
}
|
||||
|
||||
auto IkarusProject::get_function_context() -> FunctionContext * {
|
||||
auto IkarusProject::get_function_context() -> IkarusFunctionContext * {
|
||||
return &_function_contexts.emplace_back(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public:
|
|||
[[nodiscard]] auto get_db() const -> sqlitecpp::Connection const *;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_function_context() -> struct FunctionContext *;
|
||||
[[nodiscard]] auto get_function_context() -> struct IkarusFunctionContext *;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_blueprint(IkarusId id) -> struct IkarusBlueprint *;
|
||||
|
|
@ -54,7 +54,7 @@ private:
|
|||
}
|
||||
|
||||
private:
|
||||
friend struct FunctionContext;
|
||||
friend struct IkarusFunctionContext;
|
||||
|
||||
std::string _name;
|
||||
std::filesystem::path _path;
|
||||
|
|
@ -67,5 +67,5 @@ private:
|
|||
std::unordered_map<IkarusId, std::unique_ptr<IkarusProperty>> _properties;
|
||||
std::unordered_map<IkarusId, std::unique_ptr<IkarusEntity>> _entities;
|
||||
|
||||
std::vector<FunctionContext> _function_contexts;
|
||||
std::vector<IkarusFunctionContext> _function_contexts;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue