#include <binary_messenger_impl.h>
Definition at line 19 of file binary_messenger_impl.h.
◆ BinaryMessengerImpl() [1/2]
◆ ~BinaryMessengerImpl()
flutter::BinaryMessengerImpl::~BinaryMessengerImpl |
( |
| ) |
|
|
virtualdefault |
◆ BinaryMessengerImpl() [2/2]
◆ operator=()
◆ Send()
void flutter::BinaryMessengerImpl::Send |
( |
const std::string & |
channel, |
|
|
const uint8_t * |
message, |
|
|
size_t |
message_size, |
|
|
BinaryReply |
reply |
|
) |
| const |
|
overridevirtual |
Implements flutter::BinaryMessenger.
Definition at line 87 of file core_implementations.cc.
90 {
91 if (reply == nullptr) {
93 message_size);
94 return;
95 }
96 struct Captures {
98 };
99 auto captures = new Captures();
100 captures->reply = reply;
101
102 auto message_reply = [](
const uint8_t*
data,
size_t data_size,
104 auto captures =
reinterpret_cast<Captures*
>(
user_data);
105 captures->reply(
data, data_size);
106 delete captures;
107 };
109 messenger_, channel.c_str(),
message, message_size, message_reply,
110 captures);
112 delete captures;
113 }
114}
std::function< void(const uint8_t *reply, size_t reply_size)> BinaryReply
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
bool FlutterDesktopMessengerSendWithReply(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
bool FlutterDesktopMessengerSend(FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size)
◆ SetMessageHandler()
void flutter::BinaryMessengerImpl::SetMessageHandler |
( |
const std::string & |
channel, |
|
|
BinaryMessageHandler |
handler |
|
) |
| |
|
overridevirtual |
Implements flutter::BinaryMessenger.
Definition at line 116 of file core_implementations.cc.
117 {
118 if (!handler) {
119 handlers_.erase(channel);
121 nullptr);
122 return;
123 }
124
125 handlers_[channel] = std::move(handler);
127
129 ForwardToHandler, message_handler);
130}
std::function< void(const uint8_t *message, size_t message_size, BinaryReply reply)> BinaryMessageHandler
void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger, const char *channel, FlutterDesktopMessageCallback callback, void *user_data)
The documentation for this class was generated from the following files: