Flutter Engine
flutter::MethodCodec< T > Class Template Referenceabstract

#include <method_codec.h>

Public Member Functions

 MethodCodec ()=default
 
virtual ~MethodCodec ()=default
 
 MethodCodec (MethodCodec< T > const &)=delete
 
MethodCodecoperator= (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.

Referenced by flutter::TEST(), and flutter::testing::TEST().

77  {
78  return DecodeAndProcessResponseEnvelopeInternal(response, response_size,
79  result);
80  }
virtual bool DecodeAndProcessResponseEnvelopeInternal(const uint8_t *response, size_t response_size, MethodResult< T > *result) const =0
GAsyncResult * result

◆ DecodeAndProcessResponseEnvelopeInternal()

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

◆ DecodeMethodCall() [1/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.

Referenced by flutter::TEST().

33  {
34  return std::move(DecodeMethodCallInternal(message, message_size));
35  }
Win32Message message
virtual std::unique_ptr< MethodCall< T > > DecodeMethodCallInternal(const uint8_t *message, size_t message_size) const =0

◆ DecodeMethodCall() [2/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  }
Win32Message message
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data observatory The hostname IP address on which the Dart Observatory should be served If not defaults to or::depending on whether ipv6 is specified disable Disable the Dart Observatory The observatory is never available in release mode Bind to the IPv6 localhost address for the Dart Observatory Ignored if observatory host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:226
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41
virtual std::unique_ptr< MethodCall< T > > DecodeMethodCallInternal(const uint8_t *message, size_t message_size) const =0

◆ 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

◆ 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.

Referenced by flutter::EventChannel< T >::SetStreamHandler(), and flutter::TEST().

65  {
66  return std::move(
67  EncodeErrorEnvelopeInternal(error_code, error_message, error_details));
68  }
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

◆ 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

◆ 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.

Referenced by flutter::TEST(), and flutter::testing::TEST().

49  {
50  return std::move(EncodeMethodCallInternal(method_call));
51  }
G_BEGIN_DECLS FlMethodCall * method_call
virtual std::unique_ptr< std::vector< uint8_t > > EncodeMethodCallInternal(const MethodCall< T > &method_call) const =0

◆ EncodeMethodCallInternal()

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

◆ 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.

Referenced by flutter::EventChannel< T >::SetStreamHandler(), and flutter::TEST().

56  {
57  return std::move(EncodeSuccessEnvelopeInternal(result));
58  }
virtual std::unique_ptr< std::vector< uint8_t > > EncodeSuccessEnvelopeInternal(const T *result) const =0
GAsyncResult * result

◆ EncodeSuccessEnvelopeInternal()

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

◆ operator=()

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

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