diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-29 10:08:04 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-29 10:08:04 +0200 |
| commit | 8d3fc9f5f9c0593fcae9c451efe6c89c64dcbe84 (patch) | |
| tree | 8c0182f9bf94aaa8afe5126988e07af82c4409fd /cpp/nissy.h | |
| parent | cdf46d85efe7fa54e8c302a255214341c567b4af (diff) | |
| download | nissy-core-8d3fc9f5f9c0593fcae9c451efe6c89c64dcbe84.tar.gz nissy-core-8d3fc9f5f9c0593fcae9c451efe6c89c64dcbe84.zip | |
Added stop / pause / resume solve to API
Diffstat (limited to 'cpp/nissy.h')
| -rw-r--r-- | cpp/nissy.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/nissy.h b/cpp/nissy.h index 4fa98ad..41d3876 100644 --- a/cpp/nissy.h +++ b/cpp/nissy.h | |||
| @@ -46,6 +46,15 @@ namespace nissy { | |||
| 46 | static const error UNKNOWN; | 46 | static const error UNKNOWN; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | class status { | ||
| 50 | public: | ||
| 51 | int value; | ||
| 52 | |||
| 53 | static const status run; | ||
| 54 | static const status stop; | ||
| 55 | static const status pause; | ||
| 56 | }; | ||
| 57 | |||
| 49 | class cube { | 58 | class cube { |
| 50 | public: | 59 | public: |
| 51 | cube(); | 60 | cube(); |
| @@ -86,7 +95,8 @@ namespace nissy { | |||
| 86 | void unload_data(); | 95 | void unload_data(); |
| 87 | solve_result solve(const cube&, nissflag, unsigned minmoves, | 96 | solve_result solve(const cube&, nissflag, unsigned minmoves, |
| 88 | unsigned maxmoves, unsigned maxsols, unsigned optimal, | 97 | unsigned maxmoves, unsigned maxsols, unsigned optimal, |
| 89 | unsigned threads); | 98 | unsigned threads, int (*poll_status)(void *), |
| 99 | void *poll_status_data); | ||
| 90 | 100 | ||
| 91 | static std::variant<solver, error> get(const std::string&); | 101 | static std::variant<solver, error> get(const std::string&); |
| 92 | private: | 102 | private: |
