55 {
56 MethodCall<T>
method_call(method, std::move(arguments));
57 std::unique_ptr<std::vector<uint8_t>>
message =
61 return;
62 }
63
64
65
66
67 std::shared_ptr<MethodResult<T>> shared_result(
result.release());
68 const auto* codec = codec_;
69 std::string channel_name = name_;
70 BinaryReply reply_handler = [shared_result, codec, channel_name](
71 const uint8_t* reply, size_t reply_size) {
72 if (reply_size == 0) {
73 shared_result->NotImplemented();
74 return;
75 }
76
77
78 bool decoded = codec->DecodeAndProcessResponseEnvelope(
79 reply, reply_size, shared_result.get());
80 if (!decoded) {
81 std::cerr << "Unable to decode reply to method "
82 "invocation on channel "
83 << channel_name << std::endl;
84 shared_result->NotImplemented();
85 }
86 };
87
89 std::move(reply_handler));
90 }
virtual void Send(const std::string &channel, const uint8_t *message, size_t message_size, BinaryReply reply=nullptr) const =0
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
std::function< void(const uint8_t *reply, size_t reply_size)> BinaryReply