Constraints for a serializer that can be used on ports. More...
#include <xronos/sdk/port.hh>
Constraints for a serializer that can be used on ports.
S must convert values of type T to bytes and back, and name the byte layout it produces in a static encoding member. Conversions are written as calls on a serializer object. This allows conversions to be implemented either as methods or static member functions, and allows a serializer to carry configuration.
The encoding name is part of what an exported port declares, and two exported ports connect only when their encoding names are equal. It must therefore identify the layout precisely enough that any two serializers sharing a name are interchangeable, and must be a non-empty compile-time constant.
A port names its serializer as a class template, so the constraint applies to Serializer<T>.
| S | The serializer type. |
| T | The value type it converts. |