Adapter that lets a parent struct's payload field descriptor be reused by a derived struct.
More...
|
| | InheritedFieldDescriptor (std::shared_ptr< IPayloadFieldDescriptor< ParentPayload > > inner) |
| | Wrap a parent payload field descriptor.
|
| |
|
std::string_view | key () const override |
| | JSON key under which this field appears in "v".
|
| |
|
std::string_view | kind () const override |
| | Cell kind id for the field's value type.
|
| |
|
DisplayInfo | display_info () const override |
| | Display info for this field.
|
| |
|
bool | is_required () const override |
| | Whether the field must be present on deserialization.
|
| |
| json_t | to_json () const override |
| | Serialize the field descriptor itself.
|
| |
|
DisplayInfo & | mutable_display_info () override |
| | Mutable access to this field's display info — used by FieldsBuilder.
|
| |
|
void | set_required (const bool r) override |
| | Override the field's required flag.
|
| |
| void | to_json_into (json_t &v_obj, DerivedPayload const &p) const override |
| | Serialize this field from p into the value object v_obj.
|
| |
| void | from_json_into (json_t const &field_json, DerivedPayload &p, ParcelRegistry const ®) const override |
| | Deserialize this field from field_json into p.
|
| |
| void | to_string_into (std::string &out, DerivedPayload const &p) const override |
| | Append key: value for this field to the rendered string.
|
| |
| std::partial_ordering | compare (DerivedPayload const &a, DerivedPayload const &b) const override |
| | Three-way compare this field across two payload instances.
|
| |
template<typename DerivedPayload, typename ParentPayload>
class parcel::InheritedFieldDescriptor< DerivedPayload, ParentPayload >
Adapter that lets a parent struct's payload field descriptor be reused by a derived struct.
Holds a shared_ptr<IPayloadFieldDescriptor<ParentPayload>> and forwards every call after static_cast-ing the derived payload reference to the parent payload reference. The cast is sound because extend<> constrains DerivedPayload to derive from ParentPayload.
- Template Parameters
-
| DerivedPayload | The struct type using the inherited field. |
| ParentPayload | The struct type that originally declared the field. |