fix protocol functions with arguments

It invoking functions that take arguments via the protocol was temporarily broken. Such functions were invoked with undefined arguments (usually 0).
This commit is contained in:
Samuel Sadok
2018-05-14 13:55:33 -07:00
parent dc7af0e936
commit 36b13a3d27
+12
View File
@@ -812,6 +812,18 @@ public:
LOG_PROTO("my tuple is at %x and of size %u\r\n", (uintptr_t)&in_args_, sizeof(in_args_));
}
// The custom copy constructor is needed because otherwise the
// input_properties_ and output_properties_ would point to memory
// locations of the old object.
ProtocolFunction(const ProtocolFunction& other) :
name_(other.name_), obj_(other.obj_), func_ptr_(other.func_ptr_),
input_names_{other.input_names_}, output_names_{other.output_names_},
input_properties_(PropertyListFactory<TInputs...>::template make_property_list<0>(input_names_, in_args_)),
output_properties_(PropertyListFactory<TOutputs...>::template make_property_list<0>(output_names_, out_args_))
{
LOG_PROTO("COPIED! my tuple is at %x and of size %u\r\n", (uintptr_t)&in_args_, sizeof(in_args_));
}
void write_json(size_t id, StreamSink* output) {
// write name
write_string("{\"name\":\"", output);