| Flutter Linux Embedder |

Public Member Functions | Protected Member Functions | List of all members
flutter::MethodCodec< T > Class Template Referenceabstract

`#include <method_codec.h>`

## Public Member Functions
| MethodCodec ()=default
virtual | ~MethodCodec ()=default
| MethodCodec (MethodCodec< T > const &)=delete
MethodCodec & | operator= (MethodCodec< T > const &)=delete
std::unique_ptr< MethodCall< T > > | DecodeMethodCall (const uint8_t *message, size_t message_size) const
std::unique_ptr< MethodCall< T > > | DecodeMethodCall (const std::vector< uint8_t > &message) const
std::unique_ptr< std::vector< uint8_t > > | EncodeMethodCall (const MethodCall< T > &method_call) const
std::unique_ptr< std::vector< uint8_t > > | EncodeSuccessEnvelope (const T *result=nullptr) const
std::unique_ptr< std::vector< uint8_t > > | EncodeErrorEnvelope (const std::string &error_code, const std::string &error_message="", const T *error_details=nullptr) const
bool | DecodeAndProcessResponseEnvelope (const uint8_t *response, size_t response_size, MethodResult< T > *result) const

## Protected Member Functions
virtual std::unique_ptr< MethodCall< T > > | DecodeMethodCallInternal (const uint8_t *message, size_t message_size) const =0
virtual std::unique_ptr< std::vector< uint8_t > > | EncodeMethodCallInternal (const MethodCall< T > &method_call) const =0
virtual std::unique_ptr< std::vector< uint8_t > > | EncodeSuccessEnvelopeInternal (const T *result) const =0
virtual std::unique_ptr< std::vector< uint8_t > > | EncodeErrorEnvelopeInternal (const std::string &error_code, const std::string &error_message, const T *error_details) const =0
virtual bool | DecodeAndProcessResponseEnvelopeInternal (const uint8_t *response, size_t response_size, MethodResult< T > *result) const =0

## Detailed Description

### template<typename T>
class flutter::MethodCodec< T >

Definition at line 20 of file method_codec.h.

## Constructor & Destructor Documentation

## ◆ MethodCodec() [1/2]

template<typename T >

flutter::MethodCodec< T >::MethodCodec | ( |  | ) |
| default

## ◆ ~MethodCodec()

template<typename T >

virtual flutter::MethodCodec< T >::~MethodCodec | ( |  | ) |
| virtualdefault

## ◆ MethodCodec() [2/2]

template<typename T >

flutter::MethodCodec< T >::MethodCodec | ( | MethodCodec< T > const & |  | ) |
| delete

## Member Function Documentation

## ◆ DecodeAndProcessResponseEnvelope()

template<typename T >

bool flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope | ( | const uint8_t * | response,
|  | size_t | response_size,
|  | MethodResult< T > * | result
| ) |  | const
| inline

Definition at line 75 of file method_codec.h.

77 {
78 return DecodeAndProcessResponseEnvelopeInternal(response, response_size,
79 result);
80 }

Referenced by flutter::TEST().

## ◆ DecodeAndProcessResponseEnvelopeInternal()

template<typename T >

virtual bool flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelopeInternal | ( | const uint8_t * | response,
|  | size_t | response_size,
|  | MethodResult< T > * | result
| ) |  | const
| protectedpure virtual

Implemented in flutter::StandardMethodCodec, and flutter::JsonMethodCodec.

Referenced by flutter::MethodCodec< rapidjson::Document >::DecodeAndProcessResponseEnvelope().

## ◆ DecodeMethodCall() [1/2]

template<typename T >

std::unique_ptr<MethodCall<T> > flutter::MethodCodec< T >::DecodeMethodCall | ( | const std::vector< uint8_t > & | message | ) | const
| inline

Definition at line 39 of file method_codec.h.

40 {
41 size_t size = message.size();
42 const uint8_t* data = size > 0 ? &message[0] : nullptr;
43 return std::move(DecodeMethodCallInternal(data, size));
44 }

## ◆ DecodeMethodCall() [2/2]

template<typename T >

std::unique_ptr<MethodCall<T> > flutter::MethodCodec< T >::DecodeMethodCall | ( | const uint8_t * | message,
|  | size_t | message_size
| ) |  | const
| inline

Definition at line 32 of file method_codec.h.

33 {
34 return std::move(DecodeMethodCallInternal(message, message_size));
35 }

Referenced by flutter::TEST().

## ◆ DecodeMethodCallInternal()

template<typename T >

virtual std::unique_ptr<MethodCall<T> > flutter::MethodCodec< T >::DecodeMethodCallInternal | ( | const uint8_t * | message,
|  | size_t | message_size
| ) |  | const
| protectedpure virtual

Implemented in flutter::StandardMethodCodec, and flutter::JsonMethodCodec.

Referenced by flutter::MethodCodec< rapidjson::Document >::DecodeMethodCall().

## ◆ EncodeErrorEnvelope()

template<typename T >

std::unique_ptr<std::vector<uint8_t> > flutter::MethodCodec< T >::EncodeErrorEnvelope | ( | const std::string & | error_code,
|  | const std::string & | error_message = `""`,
|  | const T * | error_details = `nullptr`
| ) |  | const
| inline

Definition at line 62 of file method_codec.h.

65 {
66 return std::move(
67 EncodeErrorEnvelopeInternal(error_code, error_message, error_details));
68 }

Referenced by flutter::TEST().

## ◆ EncodeErrorEnvelopeInternal()

template<typename T >

virtual std::unique_ptr<std::vector<uint8_t> > flutter::MethodCodec< T >::EncodeErrorEnvelopeInternal | ( | const std::string & | error_code,
|  | const std::string & | error_message,
|  | const T * | error_details
| ) |  | const
| protectedpure virtual

Implemented in flutter::JsonMethodCodec, and flutter::StandardMethodCodec.

Referenced by flutter::MethodCodec< rapidjson::Document >::EncodeErrorEnvelope().

## ◆ EncodeMethodCall()

template<typename T >

std::unique_ptr<std::vector<uint8_t> > flutter::MethodCodec< T >::EncodeMethodCall | ( | const MethodCall< T > & | method_call | ) | const
| inline

Definition at line 48 of file method_codec.h.

49 {
50 return std::move(EncodeMethodCallInternal(method_call));
51 }

Referenced by flutter::TEST().

## ◆ EncodeMethodCallInternal()

template<typename T >

virtual std::unique_ptr<std::vector<uint8_t> > flutter::MethodCodec< T >::EncodeMethodCallInternal | ( | const MethodCall< T > & | method_call | ) | const
| protectedpure virtual

Implemented in flutter::JsonMethodCodec, and flutter::StandardMethodCodec.

Referenced by flutter::MethodCodec< rapidjson::Document >::EncodeMethodCall().

## ◆ EncodeSuccessEnvelope()

template<typename T >

std::unique_ptr<std::vector<uint8_t> > flutter::MethodCodec< T >::EncodeSuccessEnvelope | ( | const T * | result = `nullptr` | ) | const
| inline

Definition at line 55 of file method_codec.h.

56 {
57 return std::move(EncodeSuccessEnvelopeInternal(result));
58 }

Referenced by flutter::TEST().

## ◆ EncodeSuccessEnvelopeInternal()

template<typename T >

virtual std::unique_ptr<std::vector<uint8_t> > flutter::MethodCodec< T >::EncodeSuccessEnvelopeInternal | ( | const T * | result | ) | const
| protectedpure virtual

Implemented in flutter::JsonMethodCodec, and flutter::StandardMethodCodec.

Referenced by flutter::MethodCodec< rapidjson::Document >::EncodeSuccessEnvelope().

## ◆ operator=()

template<typename T >

MethodCodec& flutter::MethodCodec< T >::operator= | ( | MethodCodec< T > const & |  | ) |
| delete

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

- shell/platform/common/client_wrapper/include/flutter/method_codec.h

flutter::MethodCodec::EncodeMethodCallInternal
virtual std::unique_ptr< std::vector< uint8_t > > EncodeMethodCallInternal(const MethodCall< T > &method_call) const =0
flutter::MethodCodec::EncodeErrorEnvelopeInternal
virtual std::unique_ptr< std::vector< uint8_t > > EncodeErrorEnvelopeInternal(const std::string &error_code, const std::string &error_message, const T *error_details) const =0
flutter::MethodCodec::DecodeMethodCallInternal
virtual std::unique_ptr< MethodCall< T > > DecodeMethodCallInternal(const uint8_t *message, size_t message_size) const =0
method_call
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
Definition: fl_method_channel.h:120
flutter::MethodCodec::DecodeAndProcessResponseEnvelopeInternal
virtual bool DecodeAndProcessResponseEnvelopeInternal(const uint8_t *response, size_t response_size, MethodResult< T > *result) const =0
result
GAsyncResult * result
Definition: fl_text_input_handler.cc:106
flutter::MethodCodec::EncodeSuccessEnvelopeInternal
virtual std::unique_ptr< std::vector< uint8_t > > EncodeSuccessEnvelopeInternal(const T *result) const =0