41 {
42 TypeConversionResult
result;
43
44 if (!jsonArgs.is_array()) {
45 result.setError(
"arguments must be a JSON array");
47 }
48
49 fl::size received = jsonArgs.size();
51 result.setError(
"argument count mismatch: expected " +
55 }
56
57 fl::vector<unsigned char*> raw_slots;
58 fl::vector<void*> slot_ptrs;
61
62 RuntimeRpcSlotCleanup cleanup(
mArgTypes, raw_slots);
63
64 for (fl::size i = 0; i <
mArgCount; ++i) {
66
67
68
69
70
71 unsigned char* buf = new unsigned char[ops->storage_size];
74 ops->default_construct(buf);
75 cleanup.constructed = i + 1;
76
77 TypeConversionResult convResult = ops->decode(jsonArgs[i], buf);
78 for (fl::size w = 0; w < convResult.warnings().size(); ++w) {
80 ": " + convResult.warnings()[w]);
81 }
82 if (convResult.hasError()) {
84 ": " + convResult.errorMessage());
86 }
87 }
88
90
91 unsigned char* result_buf =
new unsigned char[
mResultType->storage_size];
96 delete[] result_buf;
98 }
99
102}
const RpcTypeOps *const * mArgTypes
const RpcTypeOps * mResultType
RpcTrampolineFn mTrampoline
void reserve(fl::size n) FL_NO_EXCEPT
void push_back(const T &value) FL_NO_EXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)
string to_string(T value) FL_NO_EXCEPT
tuple< typename fl::decay< Ts >::type... > make_tuple(Ts &&... args) FL_NO_EXCEPT