5 #ifndef FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_ENGINE_METHOD_RESULT_H_
6 #define FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_ENGINE_METHOD_RESULT_H_
51 std::make_unique<internal::ReplyManager>(std::move(reply_handler))),
59 std::unique_ptr<std::vector<uint8_t>> data =
60 codec_->EncodeSuccessEnvelope(result);
61 reply_manager_->SendResponseData(data.get());
66 const std::string& error_message,
67 const T* error_details)
override {
68 std::unique_ptr<std::vector<uint8_t>> data =
69 codec_->EncodeErrorEnvelope(error_code, error_message, error_details);
70 reply_manager_->SendResponseData(data.get());
75 reply_manager_->SendResponseData(
nullptr);
79 std::unique_ptr<internal::ReplyManager> reply_manager_;
void SuccessInternal(const T *result) override
~EngineMethodResult()=default
void ErrorInternal(const std::string &error_code, const std::string &error_message, const T *error_details) override
void NotImplementedInternal() override
EngineMethodResult(BinaryReply reply_handler, const MethodCodec< T > *codec)
ReplyManager(BinaryReply reply_handler_)
ReplyManager & operator=(ReplyManager const &)=delete
ReplyManager(ReplyManager const &)=delete
void SendResponseData(const std::vector< uint8_t > *data)
std::function< void(const uint8_t *reply, size_t reply_size)> BinaryReply