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

#include <message_codec.h>

Public Member Functions

 MessageCodec ()=default
 
virtual ~MessageCodec ()=default
 
 MessageCodec (MessageCodec< T > const &)=delete
 
MessageCodecoperator= (MessageCodec< T > const &)=delete
 
std::unique_ptr< T > DecodeMessage (const uint8_t *binary_message, const size_t message_size) const
 
std::unique_ptr< T > DecodeMessage (const std::vector< uint8_t > &binary_message) const
 
std::unique_ptr< std::vector< uint8_t > > EncodeMessage (const T &message) const
 

Protected Member Functions

virtual std::unique_ptr< T > DecodeMessageInternal (const uint8_t *binary_message, const size_t message_size) const =0
 
virtual std::unique_ptr< std::vector< uint8_t > > EncodeMessageInternal (const T &message) const =0
 

Detailed Description

template<typename T>
class flutter::MessageCodec< T >

Definition at line 17 of file message_codec.h.

Constructor & Destructor Documentation

◆ MessageCodec() [1/2]

template<typename T>
flutter::MessageCodec< T >::MessageCodec ( )
default

◆ ~MessageCodec()

template<typename T>
virtual flutter::MessageCodec< T >::~MessageCodec ( )
virtualdefault

◆ MessageCodec() [2/2]

template<typename T>
flutter::MessageCodec< T >::MessageCodec ( MessageCodec< T > const &  )
delete

Member Function Documentation

◆ DecodeMessage() [1/2]

template<typename T>
std::unique_ptr<T> flutter::MessageCodec< T >::DecodeMessage ( const uint8_t *  binary_message,
const size_t  message_size 
) const
inline

Definition at line 29 of file message_codec.h.

Referenced by flutter::CheckEncodeDecode(), flutter::CheckEncodeDecodeWithEncodePrefix(), flutter::JsonMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), and flutter::JsonMethodCodec::DecodeMethodCallInternal().

30  {
31  return std::move(DecodeMessageInternal(binary_message, message_size));
32  }
virtual std::unique_ptr< T > DecodeMessageInternal(const uint8_t *binary_message, const size_t message_size) const =0

◆ DecodeMessage() [2/2]

template<typename T>
std::unique_ptr<T> flutter::MessageCodec< T >::DecodeMessage ( const std::vector< uint8_t > &  binary_message) const
inline

Definition at line 36 of file message_codec.h.

37  {
38  size_t size = binary_message.size();
39  const uint8_t* data = size > 0 ? &binary_message[0] : nullptr;
40  return std::move(DecodeMessageInternal(data, size));
41  }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
virtual std::unique_ptr< T > DecodeMessageInternal(const uint8_t *binary_message, const size_t message_size) const =0

◆ DecodeMessageInternal()

template<typename T>
virtual std::unique_ptr<T> flutter::MessageCodec< T >::DecodeMessageInternal ( const uint8_t *  binary_message,
const size_t  message_size 
) const
protectedpure virtual

◆ EncodeMessage()

template<typename T>
std::unique_ptr<std::vector<uint8_t> > flutter::MessageCodec< T >::EncodeMessage ( const T &  message) const
inline

◆ EncodeMessageInternal()

template<typename T>
virtual std::unique_ptr<std::vector<uint8_t> > flutter::MessageCodec< T >::EncodeMessageInternal ( const T &  message) const
protectedpure virtual

◆ operator=()

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

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