ark::serialization::FieldDescriptor

Defined in header “ark/serialization/schema.hh”.


A field represents a particular object that will be serialized out to the bitstream.

Methods

  • bool has_attribute(FieldAttribute attribute)
    Returns true if the giveen attribute is set, false otherwise.

  • bool operator==(const FieldDescriptor & other)
    Custom comparison, so we can compare the contents of the field shared pointers, including the value and key types.

Variables

  • std::string name
    The name of this field.

  • FieldType type= FieldType::NONE
    The type of the field.

  • FieldAttribute attributes= FieldAttribute::NONE
    Any attributes applied to this field.

  • std::optional< std::string > object_type
    If this field is an ‘object’, this contains additional type information.

  • std::optional< uint32_t > array_size
    If this field is a ‘fixed size array’, this contains the size of said array.

  • FieldDescriptorPtr ctr_value_type
    If this field is a container (such as an ‘arraylist’), this contains the nested field information.

  • FieldDescriptorPtr ctr_key_type
    If this field is a container (such as a ‘dictionary’), then this contains the nested key information.

  • std::vector< std::string > comments
    A list of comments associated with this field.

  • std::map< uint8_t, std::string > variant_types
    Includes a mapping of variant types, from their tag number to their actual type name.

  • std::optional< std::string > constant_value
    If this field is constant, then this stores the value of the constant.

  • std::map< std::string, std::string > metadata
    Any associated metadata with this field. These are set in the schema as a way to add context or other useful semantics to a field.