5#ifndef FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_EVENT_STREAM_HANDLER_FUNCTIONS_H_
6#define FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_EVENT_STREAM_HANDLER_FUNCTIONS_H_
21 std::function<std::unique_ptr<StreamHandlerError<T>>(
23 std::unique_ptr<EventSink<T>>&& events)>;
27 std::function<std::unique_ptr<StreamHandlerError<T>>(
const T* arguments)>;
31template <
typename T = EncodableValue>
52 return on_listen_(arguments, std::move(events));
55 auto error = std::make_unique<StreamHandlerError<T>>(
56 "error",
"No OnListen handler set",
nullptr);
57 return std::move(
error);
62 const T* arguments)
override {
67 auto error = std::make_unique<StreamHandlerError<T>>(
68 "error",
"No OnCancel handler set",
nullptr);
69 return std::move(
error);
std::unique_ptr< StreamHandlerError< T > > OnListenInternal(const T *arguments, std::unique_ptr< EventSink< T > > &&events) override
virtual ~StreamHandlerFunctions()=default
StreamHandlerCancel< T > on_cancel_
std::unique_ptr< StreamHandlerError< T > > OnCancelInternal(const T *arguments) override
StreamHandlerListen< T > on_listen_
StreamHandlerFunctions(StreamHandlerFunctions const &)=delete
StreamHandlerFunctions & operator=(StreamHandlerFunctions const &)=delete
StreamHandlerFunctions(StreamHandlerListen< T > on_listen, StreamHandlerCancel< T > on_cancel)
const uint8_t uint32_t uint32_t GError ** error
std::function< std::unique_ptr< StreamHandlerError< T > >(const T *arguments, std::unique_ptr< EventSink< T > > &&events)> StreamHandlerListen
std::function< std::unique_ptr< StreamHandlerError< T > >(const T *arguments)> StreamHandlerCancel