Skip to content

Allow extending C++ StandardMethodCodec #31174

@stuartmorgan-g

Description

@stuartmorgan-g

The current C++ implementation of StandardMethodCodec/StandardMessageCodec doesn't allow client extensions, which is supported on other platforms, and require for compatibility with plugins that use it in their current implementations.

The approach I have in mind is:

  • Add one more type to EncodableValue for extensions, and have that extension type store a void* value along with function pointers for delete, copy, and optionally compare. Then there would be all the usual associated methods (IsExtension, ExtensionValue, etc.).
  • Make the serializer class subclassable, with a method that is called for reading and writing values when an extension type is encountered.

The reason for this approach rather than something subclassing based is that this should be something that would continue to work even if the codecs are moved into the libraries. We'll need to evaluate how onerous that ends up being to use; my hope is that it should be straightforward for someone extending to make an adapter that hides most of that complexity from most of the call sites.

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopengineflutter/engine related. See also e: labels.platform-linuxBuilding on or for Linux specificallyplatform-windowsBuilding on or for Windows specifically

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions