Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
flutter::SomeDataExtensionSerializer Class Reference

#include <test_codec_extensions.h>

Inheritance diagram for flutter::SomeDataExtensionSerializer:
flutter::StandardCodecSerializer

Public Member Functions

 SomeDataExtensionSerializer ()
 
virtual ~SomeDataExtensionSerializer ()
 
EncodableValue ReadValueOfType (uint8_t type, ByteStreamReader *stream) const override
 
void WriteValue (const EncodableValue &value, ByteStreamWriter *stream) const override
 
- Public Member Functions inherited from flutter::StandardCodecSerializer
virtual ~StandardCodecSerializer ()
 
 StandardCodecSerializer (StandardCodecSerializer const &)=delete
 
StandardCodecSerializeroperator= (StandardCodecSerializer const &)=delete
 
EncodableValue ReadValue (ByteStreamReader *stream) const
 

Static Public Member Functions

static const SomeDataExtensionSerializerGetInstance ()
 
- Static Public Member Functions inherited from flutter::StandardCodecSerializer
static const StandardCodecSerializerGetInstance ()
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::StandardCodecSerializer
 StandardCodecSerializer ()
 
size_t ReadSize (ByteStreamReader *stream) const
 
void WriteSize (size_t size, ByteStreamWriter *stream) const
 

Detailed Description

Definition at line 68 of file test_codec_extensions.h.

Constructor & Destructor Documentation

◆ SomeDataExtensionSerializer()

flutter::SomeDataExtensionSerializer::SomeDataExtensionSerializer ( )
default

◆ ~SomeDataExtensionSerializer()

flutter::SomeDataExtensionSerializer::~SomeDataExtensionSerializer ( )
virtualdefault

Member Function Documentation

◆ GetInstance()

const SomeDataExtensionSerializer & flutter::SomeDataExtensionSerializer::GetInstance ( )
static

Definition at line 46 of file test_codec_extensions.cc.

46 {
47 static SomeDataExtensionSerializer sInstance;
48 return sInstance;
49}

◆ ReadValueOfType()

EncodableValue flutter::SomeDataExtensionSerializer::ReadValueOfType ( uint8_t  type,
ByteStreamReader stream 
) const
overridevirtual

Reimplemented from flutter::StandardCodecSerializer.

Definition at line 51 of file test_codec_extensions.cc.

53 {
54 if (type == kSomeDataType) {
55 size_t size = ReadSize(stream);
56 std::vector<uint8_t> data;
57 data.resize(size);
58 stream->ReadBytes(data.data(), size);
59 EncodableValue label = ReadValue(stream);
60 return CustomEncodableValue(SomeData(std::get<std::string>(label), data));
61 }
63}
EncodableValue ReadValue(ByteStreamReader *stream) const
virtual EncodableValue ReadValueOfType(uint8_t type, ByteStreamReader *stream) const
size_t ReadSize(ByteStreamReader *stream) const
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
it will be possible to load the file into Perfetto s trace viewer 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:259

◆ WriteValue()

void flutter::SomeDataExtensionSerializer::WriteValue ( const EncodableValue value,
ByteStreamWriter stream 
) const
overridevirtual

Reimplemented from flutter::StandardCodecSerializer.

Definition at line 65 of file test_codec_extensions.cc.

66 {
67 auto custom_value = std::get_if<CustomEncodableValue>(&value);
68 if (!custom_value) {
70 return;
71 }
72 stream->WriteByte(kSomeDataType);
73 const SomeData& some_data = std::any_cast<SomeData>(*custom_value);
74 size_t data_size = some_data.data().size();
75 WriteSize(data_size, stream);
76 stream->WriteBytes(some_data.data().data(), data_size);
77 WriteValue(EncodableValue(some_data.label()), stream);
78}
void WriteValue(const EncodableValue &value, ByteStreamWriter *stream) const override
virtual void WriteValue(const EncodableValue &value, ByteStreamWriter *stream) const
void WriteSize(size_t size, ByteStreamWriter *stream) const

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