Flutter Engine
flutter::StreamHandlerFunctions< T > Class Template Reference

#include <event_stream_handler_functions.h>

Inheritance diagram for flutter::StreamHandlerFunctions< T >:
flutter::StreamHandler< T >

Public Member Functions

 StreamHandlerFunctions (StreamHandlerListen< T > on_listen, StreamHandlerCancel< T > on_cancel)
 
virtual ~StreamHandlerFunctions ()=default
 
 StreamHandlerFunctions (StreamHandlerFunctions const &)=delete
 
StreamHandlerFunctionsoperator= (StreamHandlerFunctions const &)=delete
 
- Public Member Functions inherited from flutter::StreamHandler< T >
 StreamHandler ()=default
 
virtual ~StreamHandler ()=default
 
 StreamHandler (StreamHandler const &)=delete
 
StreamHandleroperator= (StreamHandler const &)=delete
 
std::unique_ptr< StreamHandlerError< T > > OnListen (const T *arguments, std::unique_ptr< EventSink< T >> &&events)
 
std::unique_ptr< StreamHandlerError< T > > OnCancel (const T *arguments)
 

Protected Member Functions

std::unique_ptr< StreamHandlerError< T > > OnListenInternal (const T *arguments, std::unique_ptr< EventSink< T >> &&events) override
 
std::unique_ptr< StreamHandlerError< T > > OnCancelInternal (const T *arguments) override
 

Protected Attributes

StreamHandlerListen< T > on_listen_
 
StreamHandlerCancel< T > on_cancel_
 

Detailed Description

template<typename T = EncodableValue>
class flutter::StreamHandlerFunctions< T >

Definition at line 32 of file event_stream_handler_functions.h.

Constructor & Destructor Documentation

◆ StreamHandlerFunctions() [1/2]

template<typename T = EncodableValue>
flutter::StreamHandlerFunctions< T >::StreamHandlerFunctions ( StreamHandlerListen< T >  on_listen,
StreamHandlerCancel< T >  on_cancel 
)
inline

◆ ~StreamHandlerFunctions()

template<typename T = EncodableValue>
virtual flutter::StreamHandlerFunctions< T >::~StreamHandlerFunctions ( )
virtualdefault

◆ StreamHandlerFunctions() [2/2]

template<typename T = EncodableValue>
flutter::StreamHandlerFunctions< T >::StreamHandlerFunctions ( StreamHandlerFunctions< T > const &  )
delete

Member Function Documentation

◆ OnCancelInternal()

template<typename T = EncodableValue>
std::unique_ptr<StreamHandlerError<T> > flutter::StreamHandlerFunctions< T >::OnCancelInternal ( const T *  arguments)
inlineoverrideprotectedvirtual

Implements flutter::StreamHandler< T >.

Definition at line 61 of file event_stream_handler_functions.h.

References error, and flutter::StreamHandlerFunctions< T >::on_cancel_.

62  {
63  if (on_cancel_) {
64  return on_cancel_(arguments);
65  }
66 
67  auto error = std::make_unique<StreamHandlerError<T>>(
68  "error", "No OnCancel handler set", nullptr);
69  return std::move(error);
70  }
FlMethodResponse GError ** error

◆ OnListenInternal()

template<typename T = EncodableValue>
std::unique_ptr<StreamHandlerError<T> > flutter::StreamHandlerFunctions< T >::OnListenInternal ( const T *  arguments,
std::unique_ptr< EventSink< T >> &&  events 
)
inlineoverrideprotectedvirtual

Implements flutter::StreamHandler< T >.

Definition at line 48 of file event_stream_handler_functions.h.

References error, and flutter::StreamHandlerFunctions< T >::on_listen_.

50  {
51  if (on_listen_) {
52  return on_listen_(arguments, std::move(events));
53  }
54 
55  auto error = std::make_unique<StreamHandlerError<T>>(
56  "error", "No OnListen handler set", nullptr);
57  return std::move(error);
58  }
FlMethodResponse GError ** error

◆ operator=()

template<typename T = EncodableValue>
StreamHandlerFunctions& flutter::StreamHandlerFunctions< T >::operator= ( StreamHandlerFunctions< T > const &  )
delete

Member Data Documentation

◆ on_cancel_

template<typename T = EncodableValue>
StreamHandlerCancel<T> flutter::StreamHandlerFunctions< T >::on_cancel_
protected

◆ on_listen_

template<typename T = EncodableValue>
StreamHandlerListen<T> flutter::StreamHandlerFunctions< T >::on_listen_
protected

The documentation for this class was generated from the following file: