Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
flutter::PointExtensionSerializer Class Reference

#include <test_codec_extensions.h>

Inheritance diagram for flutter::PointExtensionSerializer:
flutter::StandardCodecSerializer

Public Member Functions

 PointExtensionSerializer ()
 
virtual ~PointExtensionSerializer ()
 
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
 
virtual void WriteValue (const EncodableValue &value, ByteStreamWriter *stream) const
 

Static Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Definition at line 48 of file test_codec_extensions.h.

Constructor & Destructor Documentation

◆ PointExtensionSerializer()

flutter::PointExtensionSerializer::PointExtensionSerializer ( )
default

◆ ~PointExtensionSerializer()

flutter::PointExtensionSerializer::~PointExtensionSerializer ( )
virtualdefault

Member Function Documentation

◆ GetInstance()

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

Definition at line 13 of file test_codec_extensions.cc.

13 {
14 static PointExtensionSerializer sInstance;
15 return sInstance;
16}

◆ ReadValueOfType()

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

Reimplemented from flutter::StandardCodecSerializer.

Definition at line 18 of file test_codec_extensions.cc.

20 {
21 if (type == kPointType) {
22 int32_t x = stream->ReadInt32();
23 int32_t y = stream->ReadInt32();
24 return CustomEncodableValue(Point(x, y));
25 }
27}
GLenum type
virtual EncodableValue ReadValueOfType(uint8_t type, ByteStreamReader *stream) const
double y
double x
TPoint< Scalar > Point
Definition: point.h:322

◆ WriteValue()

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

Reimplemented from flutter::StandardCodecSerializer.

Definition at line 29 of file test_codec_extensions.cc.

30 {
31 auto custom_value = std::get_if<CustomEncodableValue>(&value);
32 if (!custom_value) {
34 return;
35 }
36 stream->WriteByte(kPointType);
37 const Point& point = std::any_cast<Point>(*custom_value);
38 stream->WriteInt32(point.x());
39 stream->WriteInt32(point.y());
40}
virtual void WriteValue(const EncodableValue &value, ByteStreamWriter *stream) const
uint8_t value

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