Skip to content

Commit b9436ce

Browse files
committed
feat(api): add native process message function
1 parent 69395c8 commit b9436ce

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

libs/api/include/rtbot/bindings.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <cstdint>
55
#include <map>
6+
#include <memory>
67
#include <optional>
78
#include <string>
89
#include <vector>
@@ -16,10 +17,8 @@ Bytes collect(string const& programId);
1617
// after creating a program, we can restore it with the a collected state
1718
void restore(string const& programId, Bytes const& bytes);
1819

19-
// TODO
20-
/*const ProgramMessage<uint64_t, double>& processMessageMapNative(string const& programId,
21-
const OperatorMessage<uint64_t, double>& messagesMap);
22-
*/
20+
ProgramMessage<uint64_t, double> processMessageMapNative(string const& programId,
21+
const OperatorMessage<uint64_t, double>& messagesMap);
2322

2423
string validate(string const& json_program);
2524
string validateOperator(string const& type, string const& json_op);

libs/api/src/bindings.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <algorithm>
44
#include <chrono>
5+
#include <memory>
56
#include <nlohmann/json-schema.hpp>
67
#include <nlohmann/json.hpp>
78
#include <optional>
@@ -43,6 +44,11 @@ Bytes collect(string const& programId) { return factory.collect(programId); }
4344

4445
void restore(string const& programId, Bytes const& bytes) { factory.restore(programId, bytes); }
4546

47+
ProgramMessage<uint64_t, double> processMessageMapNative(string const& programId,
48+
const OperatorMessage<uint64_t, double>& messagesMap) {
49+
return factory.processMessageMap(programId, messagesMap);
50+
}
51+
4652
string validateOperator(string const& type, string const& json_op) {
4753
json_validator validator(nullptr, nlohmann::json_schema::default_string_format_check); // create validator
4854

0 commit comments

Comments
 (0)