#include <method_channel.h>
template<typename T = EncodableValue>
class flutter::MethodChannel< T >
Definition at line 33 of file method_channel.h.
◆ MethodChannel() [1/2]
template<typename T = EncodableValue>
Definition at line 37 of file method_channel.h.
40 : messenger_(messenger), name_(name), codec_(codec) {}
◆ ~MethodChannel()
template<typename T = EncodableValue>
◆ MethodChannel() [2/2]
template<typename T = EncodableValue>
◆ InvokeMethod()
template<typename T = EncodableValue>
Definition at line 52 of file method_channel.h.
55 MethodCall<T>
method_call(method, std::move(arguments));
56 std::unique_ptr<std::vector<uint8_t>> message =
59 messenger_->
Send(name_, message->data(), message->size(),
nullptr);
66 std::shared_ptr<MethodResult<T>> shared_result(
result.release());
67 const auto* codec = codec_;
68 std::string channel_name = name_;
69 BinaryReply reply_handler = [shared_result, codec, channel_name](
70 const uint8_t* reply,
size_t reply_size) {
71 if (reply_size == 0) {
72 shared_result->NotImplemented();
77 bool decoded = codec->DecodeAndProcessResponseEnvelope(
78 reply, reply_size, shared_result.get());
80 std::cerr <<
"Unable to decode reply to method "
81 "invocation on channel "
82 << channel_name << std::endl;
83 shared_result->NotImplemented();
87 messenger_->
Send(name_, message->data(), message->size(),
88 std::move(reply_handler));
References method_call, result, and flutter::BinaryMessenger::Send().
Referenced by flutter::TEST().
◆ operator=()
template<typename T = EncodableValue>
◆ SetMethodCallHandler()
template<typename T = EncodableValue>
Definition at line 98 of file method_channel.h.
103 const auto* codec = codec_;
104 std::string channel_name = name_;
106 const uint8_t* message,
111 std::make_unique<EngineMethodResult<T>>(std::move(reply), codec);
113 codec->DecodeMethodCall(message, message_size);
115 std::cerr <<
"Unable to construct method call from message on channel "
116 << channel_name << std::endl;
References method_call, result, and flutter::BinaryMessenger::SetMessageHandler().
Referenced by flutter::TEST().
The documentation for this class was generated from the following file: