-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): add helpers to use schema for stronly-typed ops, ref #149
- Loading branch information
Showing
6 changed files
with
45 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ target_link_libraries(ac-local | |
PUBLIC | ||
ac::astl | ||
ac::dict | ||
ac::schema | ||
) | ||
|
||
configure_file( | ||
|
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,20 @@ | ||
// Copyright (c) Alpaca Core | ||
// SPDX-License-Identifier: MIT | ||
// | ||
#pragma once | ||
#include <ac/local/Model.hpp> | ||
#include <ac/local/Instance.hpp> | ||
|
||
namespace ac::local { | ||
|
||
template <typename Instance> | ||
auto Model_createInstance(ac::local::Model& model, typename Instance::Params p) { | ||
return model.createInstance(Instance::id, p.toDict()); | ||
} | ||
|
||
template <typename Op> | ||
typename Op::Return Instance_runOp(ac::local::Instance& instance, typename Op::Params p) { | ||
return Op::Return::fromDict(instance.runOp(Op::id, p.toDict())); | ||
} | ||
|
||
} // namespace ac::local |
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