-
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.
- Loading branch information
包仁义
committed
Aug 11, 2022
1 parent
b976dc6
commit 3dbff1f
Showing
15 changed files
with
128 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
/.vscode/ | ||
|
||
# add symlinks | ||
bazel-bin | ||
bazel-mpc-toolkit | ||
bazel-out | ||
bazel-testlogs | ||
bazel-testlogs | ||
|
||
### Added by Hedron's Bazel Compile Commands Extractor: https://github.com/hedronvision/bazel-compile-commands-extractor | ||
# The external link: Differs on Windows vs macOS/Linux, so we can't check it in. The pattern needs to not have a trailing / because it's a symlink on macOS/Linux. | ||
/external | ||
# Bazel output symlinks: Same reasoning as /external. You need the * because people can change the name of the directory your repository is cloned into, changing the bazel-<workspace_name> symlink. | ||
/bazel-* | ||
# Compiled output -> don't check in | ||
/compile_commands.json | ||
# Directory where clangd puts its indexing work | ||
/.cache/ |
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 |
---|---|---|
@@ -1 +1,24 @@ | ||
# mpc-toolkit | ||
# mpc-toolkit | ||
|
||
## 环境初始化 | ||
|
||
```bash | ||
$ git clone https://github.com/baobaoyeye/mpc-toolkit.git | ||
$ cd mpc-toolkit | ||
``` | ||
|
||
bazel+clangd生成compile_commands.json | ||
[compilation-database.html#bazel](https://sarcasm.github.io/notes/dev/compilation-database.html#bazel) | ||
[bazel-compile-commands-extractor](https://github.com/hedronvision/bazel-compile-commands-extractor) | ||
|
||
```bash | ||
# 生成在根目录生成 compile_commands.json | ||
$ bazel run @hedron_compile_commands//:refresh_all | ||
``` | ||
|
||
## 编译构建 | ||
|
||
```bash | ||
# 全部编译 | ||
$ bazel build //... -c dbg | ||
``` |
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
File renamed without changes.
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,14 @@ | ||
load("//bazel:mpct.bzl", "mpct_cc_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
mpct_cc_library( | ||
name = "task", | ||
hdrs = ["task.hpp"], | ||
) | ||
|
||
mpct_cc_library( | ||
name = "executor", | ||
hdrs = ["executor.hpp"], | ||
deps = [":task"], | ||
) |
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,22 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "mpct/common/task.hpp" | ||
|
||
class Executor { | ||
public: | ||
virtual ~Executor() = default; | ||
virtual void execute(const Task& task); | ||
virtual void executeAll(const Task& task); | ||
}; | ||
|
||
class PlainExecutor : public Executor { | ||
public: | ||
virtual ~PlainExecutor() = default; | ||
}; | ||
|
||
class SecureExecutor : public Executor { | ||
public: | ||
virtual ~SecureExecutor() = default; | ||
}; |
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,5 @@ | ||
#pragma once | ||
|
||
class Task { | ||
|
||
}; |
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
load("//bazel:mpct.bzl", "mpct_cc_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
mpct_cc_library( | ||
name = "party", | ||
srcs = ["party.cpp"], | ||
hdrs = ["party.hpp"], | ||
deps = ["//mpct/common:executor"], | ||
) |
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,8 @@ | ||
|
||
#include "mpct/network/party.hpp" | ||
#include "spdlog/spdlog.h" | ||
|
||
|
||
Party::Party() { | ||
SPDLOG_INFO("create party"); | ||
} |
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,13 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include "mpct/common/executor.hpp" | ||
|
||
class Party { | ||
public: | ||
Party(); | ||
~Party(); | ||
private: | ||
uint32_t party_id; | ||
Executor* executor; | ||
}; |
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