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

#include <method_result_functions.h>

Inheritance diagram for flutter::MethodResultFunctions< T >:
flutter::MethodResult< T >

Public Member Functions

 MethodResultFunctions (ResultHandlerSuccess< T > on_success, ResultHandlerError< T > on_error, ResultHandlerNotImplemented< T > on_not_implemented)
 
virtual ~MethodResultFunctions ()=default
 
 MethodResultFunctions (MethodResultFunctions const &)=delete
 
MethodResultFunctionsoperator= (MethodResultFunctions const &)=delete
 
- Public Member Functions inherited from flutter::MethodResult< T >
 MethodResult ()=default
 
virtual ~MethodResult ()=default
 
 MethodResult (MethodResult const &)=delete
 
MethodResultoperator= (MethodResult const &)=delete
 
void Success (const T &result)
 
void Success ()
 
void Error (const std::string &error_code, const std::string &error_message, const T &error_details)
 
void Error (const std::string &error_code, const std::string &error_message="")
 
void NotImplemented ()
 

Protected Member Functions

void SuccessInternal (const T *result) override
 
void ErrorInternal (const std::string &error_code, const std::string &error_message, const T *error_details) override
 
void NotImplementedInternal () override
 

Detailed Description

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

Definition at line 30 of file method_result_functions.h.

Constructor & Destructor Documentation

◆ MethodResultFunctions() [1/2]

template<typename T = EncodableValue>
flutter::MethodResultFunctions< T >::MethodResultFunctions ( ResultHandlerSuccess< T >  on_success,
ResultHandlerError< T >  on_error,
ResultHandlerNotImplemented< T >  on_not_implemented 
)
inline

Definition at line 34 of file method_result_functions.h.

References flutter::MethodResultFunctions< T >::operator=(), and flutter::MethodResultFunctions< T >::~MethodResultFunctions().

37  : on_success_(on_success),
38  on_error_(on_error),
39  on_not_implemented_(on_not_implemented) {}

◆ ~MethodResultFunctions()

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

◆ MethodResultFunctions() [2/2]

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

Member Function Documentation

◆ ErrorInternal()

template<typename T = EncodableValue>
void flutter::MethodResultFunctions< T >::ErrorInternal ( const std::string &  error_code,
const std::string &  error_message,
const T *  error_details 
)
inlineoverrideprotectedvirtual

Implements flutter::MethodResult< T >.

Definition at line 56 of file method_result_functions.h.

58  {
59  if (on_error_) {
60  on_error_(error_code, error_message, error_details);
61  }
62  }

◆ NotImplementedInternal()

template<typename T = EncodableValue>
void flutter::MethodResultFunctions< T >::NotImplementedInternal ( )
inlineoverrideprotectedvirtual

Implements flutter::MethodResult< T >.

Definition at line 65 of file method_result_functions.h.

65  {
66  if (on_not_implemented_) {
67  on_not_implemented_();
68  }
69  }

◆ operator=()

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

◆ SuccessInternal()

template<typename T = EncodableValue>
void flutter::MethodResultFunctions< T >::SuccessInternal ( const T *  result)
inlineoverrideprotectedvirtual

Implements flutter::MethodResult< T >.

Definition at line 49 of file method_result_functions.h.

49  {
50  if (on_success_) {
51  on_success_(result);
52  }
53  }

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