Skip to content

serialize.fill_generic

Full path: schola.core.protocols.protobuf.serialize.fill_generic

schola.core.protocols.protobuf.serialize.fill_generic

fill_generic

fill_generic(obj, generic_obj)

Fill a generic protobuf Point or Space message with a specific typed message.

This function is used to populate generic protobuf messages (which use oneof fields) with specific typed messages (like BoxSpace, DiscretePoint, etc.).

Parameters

obj (Any) : The specific protobuf message (e.g., BoxSpace, DiscretePoint).

generic_obj (Any) : The generic container protobuf message to fill (e.g., Space, Point).

Raises

  • ValueError - If the message type is not supported.

Returns

None

Notes

This function modifies generic_obj in place using protobuf’s CopyFrom method.

None