|
DCCL v5
|
Provides a base class for defining DCCL field encoders / decoders. Most users who wish to define custom encoders/decoders will use the RepeatedTypedFieldCodec, TypedFieldCodec or its children (e.g. TypedFixedFieldCodec) instead of directly inheriting from this class. More...
#include <dccl/field_codec.h>

Public Member Functions | |
Constructor, Destructor | |
Base message functions | |
| void | base_encode (Bitset *bits, const google::protobuf::Message &msg, MessagePart part, bool strict) |
| Encode this part (body or head) of the base message. | |
| void | base_size (unsigned *bit_size, const google::protobuf::Message &msg, MessagePart part) |
| Calculate the size (in bits) of a part of the base message when it is encoded. | |
| void | base_decode (Bitset *bits, google::protobuf::Message *msg, MessagePart part) |
| Decode part of a message. | |
| void | base_max_size (unsigned *bit_size, const google::protobuf::Descriptor *desc, MessagePart part) |
| Calculate the maximum size of a message given its Descriptor alone (no data) | |
| void | base_min_size (unsigned *bit_size, const google::protobuf::Descriptor *desc, MessagePart part) |
| Calculate the minimum size of a message given its Descriptor alone (no data) | |
| void | base_validate (const google::protobuf::Descriptor *desc, MessagePart part) |
| Validate this part of the message to make sure all required extensions are set. | |
| void | base_info (std::ostream *os, const google::protobuf::Descriptor *desc, MessagePart part) |
| Get human readable information (size of fields, etc.) about this part of the DCCL message. | |
| void | base_hash (std::size_t *hash, const google::protobuf::Descriptor *desc, MessagePart part) |
| Provide a hash of the DCCL message definition to detect changes in the DCCL message. | |
Field functions (primitive types and embedded messages) | |
| class | FieldCodecManagerLocal |
| struct | BaseRAII |
| void | field_pre_encode (dccl::any *wire_value, const dccl::any &field_value) |
| Pre-encodes a non-repeated (i.e. optional or required) field by converting the FieldType representation (the Google Protobuf representation) into the WireType representation (the type used in the encoded DCCL message). This allows for type-converting codecs. | |
| void | field_pre_encode_repeated (std::vector< dccl::any > *wire_values, const std::vector< dccl::any > &field_values) |
| Pre-encodes a repeated field. | |
| void | field_encode (Bitset *bits, const dccl::any &field_value, const google::protobuf::FieldDescriptor *field) |
| Encode a non-repeated field. | |
| void | field_encode_repeated (Bitset *bits, const std::vector< dccl::any > &field_values, const google::protobuf::FieldDescriptor *field) |
| Encode a repeated field. | |
| void | field_size (unsigned *bit_size, const dccl::any &field_value, const google::protobuf::FieldDescriptor *field) |
| Calculate the size of a field. | |
| void | field_size_repeated (unsigned *bit_size, const std::vector< dccl::any > &field_values, const google::protobuf::FieldDescriptor *field) |
| Calculate the size of a repeated field. | |
| void | field_decode (Bitset *bits, dccl::any *field_value, const google::protobuf::FieldDescriptor *field) |
| Decode a non-repeated field. | |
| void | field_decode_repeated (Bitset *bits, std::vector< dccl::any > *field_values, const google::protobuf::FieldDescriptor *field) |
| Decode a repeated field. | |
| void | field_post_decode (const dccl::any &wire_value, dccl::any *field_value) |
| Post-decodes a non-repeated (i.e. optional or required) field by converting the WireType (the type used in the encoded DCCL message) representation into the FieldType representation (the Google Protobuf representation). This allows for type-converting codecs. | |
| void | field_post_decode_repeated (const std::vector< dccl::any > &wire_values, std::vector< dccl::any > *field_values) |
| Post-decodes a repeated field. | |
| void | field_max_size (unsigned *bit_size, const google::protobuf::FieldDescriptor *field) |
| Calculate the upper bound on this field's size (in bits) | |
| void | field_min_size (unsigned *bit_size, const google::protobuf::FieldDescriptor *field) |
| Calculate the lower bound on this field's size (in bits) | |
| void | field_validate (bool *b, const google::protobuf::FieldDescriptor *field) |
| Validate this field, checking that all required option extensions are set (e.g. (dccl.field).max and (dccl.field).min for arithmetic codecs) | |
| void | field_info (std::ostream *os, const google::protobuf::FieldDescriptor *field) |
| Write human readable information about the field and its bounds to the provided stream. | |
| void | field_hash (std::size_t *hash, const google::protobuf::FieldDescriptor *field) |
| Provide a hash for this field definition. | |
| dccl::DCCLFieldOptions | dccl_field_options () const |
| Get the DCCL field option extension value for the current field. | |
| void | require (bool b, const std::string &description) |
| Essentially an assertion to be used in the validate() virtual method. | |
| DynamicConditions & | dynamic_conditions (const google::protobuf::FieldDescriptor *field) |
| FieldCodecManagerLocal & | manager () |
| const FieldCodecManagerLocal & | manager () const |
| virtual void | set_manager (FieldCodecManagerLocal *manager) |
| bool | use_required () |
| Whether to use the required or optional encoding. | |
| virtual void | any_encode (Bitset *bits, const dccl::any &wire_value)=0 |
| Virtual method used to encode. | |
| virtual void | any_decode (Bitset *bits, dccl::any *wire_value)=0 |
| Virtual method used to decode. | |
| virtual void | any_pre_encode (dccl::any *wire_value, const dccl::any &field_value) |
| Virtual method used to pre-encode (convert from FieldType to WireType). The default implementation of this method is for when WireType == FieldType and simply copies the field_value to the wire_value. | |
| virtual void | any_post_decode (const dccl::any &wire_value, dccl::any *field_value) |
| Virtual method used to post-decode (convert from WireType to FieldType). The default implementation of this method is for when WireType == FieldType and simply copies the wire_value to the field_value. | |
| virtual unsigned | any_size (const dccl::any &wire_value)=0 |
| Virtual method for calculating the size of a field (in bits). | |
| virtual void | validate () |
| Validate a field. Use require() inside your overloaded validate() to assert requirements or throw Exceptions directly as needed. | |
| virtual std::string | info () |
| Write field specific information (in addition to general information such as sizes that are automatically written by this class for all fields. | |
| virtual std::size_t | hash () |
| Generate a field specific hash to be combined with the descriptor hash. | |
| virtual unsigned | max_size ()=0 |
| Calculate maximum size of the field in bits. | |
| virtual unsigned | min_size ()=0 |
| Calculate minimum size of the field in bits. | |
| virtual void | any_encode_repeated (Bitset *bits, const std::vector< dccl::any > &wire_values) |
| virtual void | any_decode_repeated (Bitset *repeated_bits, std::vector< dccl::any > *field_values) |
| virtual void | any_pre_encode_repeated (std::vector< dccl::any > *wire_values, const std::vector< dccl::any > &field_values) |
| virtual void | any_post_decode_repeated (const std::vector< dccl::any > &wire_values, std::vector< dccl::any > *field_values) |
| virtual unsigned | any_size_repeated (const std::vector< dccl::any > &wire_values) |
| virtual unsigned | max_size_repeated () |
| virtual unsigned | min_size_repeated () |
| void | check_repeat_settings () const |
Information Methods | |
| std::string | name () const |
| the name of the codec used to identifier it in the .proto custom option extension | |
| google::protobuf::FieldDescriptor::Type | field_type () const |
| the type exposed to the user in the original and decoded Protobuf messages | |
| google::protobuf::FieldDescriptor::CppType | wire_type () const |
| the C++ type used "on the wire". This is the type visible after pre_encode and before post_decode functions are called. | |
| const google::protobuf::FieldDescriptor * | this_field () const |
| Returns the FieldDescriptor (field schema meta-data) for this field. | |
| const google::protobuf::Descriptor * | this_descriptor () const |
| Returns the Descriptor (message schema meta-data) for the immediate parent Message. | |
| const google::protobuf::Message * | this_message () |
| const google::protobuf::Message * | root_message () |
| const google::protobuf::Descriptor * | root_descriptor () const |
| const Bitset * | root_bitset () const |
| Returns the root Bitset for the current encode or decode operation. | |
| internal::MessageStackData & | message_data () |
| const internal::MessageStackData & | message_data () const |
| bool | has_codec_group () |
| std::string | codec_group () |
| int | codec_version () |
| MessagePart | part () |
| the part of the message currently being encoded (head or body) | |
| bool | strict () |
| void | set_force_use_required (bool force_required=true) |
| Force the codec to always use the "required" field encoding, regardless of the FieldDescriptor setting. Useful when wrapping this codec in another that handles optional and repeated fields. | |
| static std::string | codec_group (const google::protobuf::Descriptor *desc) |
Provides a base class for defining DCCL field encoders / decoders. Most users who wish to define custom encoders/decoders will use the RepeatedTypedFieldCodec, TypedFieldCodec or its children (e.g. TypedFixedFieldCodec) instead of directly inheriting from this class.
Definition at line 52 of file field_codec.h.
|
protectedpure virtual |
Virtual method used to decode.
| bits | Bitset containing bits to decode. This will initially contain min_size() bits. If you need more bits, call get_more_bits() with the number of bits required. This bits will be consumed from the bit pool and placed in bits. |
| wire_value | Place to store decoded value (as FieldType) |
|
protectedvirtual |
Definition at line 518 of file field_codec.cpp.
|
protectedpure virtual |
Virtual method used to encode.
| bits | Bitset to store encoded bits. Bits is just the bits from the current operation (unlike base_encode() and field_encode() where bits are added to the most significant end). |
| wire_value | Value to encode (WireType) |
|
protectedvirtual |
Definition at line 458 of file field_codec.cpp.
|
inlineprotectedvirtual |
Virtual method used to post-decode (convert from WireType to FieldType). The default implementation of this method is for when WireType == FieldType and simply copies the wire_value to the field_value.
| wire_value | Value to convert (WireType) |
| field_value | Converted value (FieldType) |
Definition at line 445 of file field_codec.h.
|
protectedvirtual |
Definition at line 638 of file field_codec.cpp.
|
inlineprotectedvirtual |
Virtual method used to pre-encode (convert from FieldType to WireType). The default implementation of this method is for when WireType == FieldType and simply copies the field_value to the wire_value.
| wire_value | Converted value (WireType) |
| field_value | Value to convert (FieldType) |
Definition at line 436 of file field_codec.h.
|
protectedvirtual |
Definition at line 628 of file field_codec.cpp.
|
protectedpure virtual |
Virtual method for calculating the size of a field (in bits).
| wire_value | Value to calculate size of |
|
protectedvirtual |
Definition at line 553 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_decode | ( | Bitset * | bits, |
| google::protobuf::Message * | msg, | ||
| MessagePart | part | ||
| ) |
Decode part of a message.
| bits | Pointer to a Bitset containing bits to decode. The least significant bits will be consumed first. Any bits not consumed will remain in bits after this method returns. |
| msg | DCCL Message to merge the decoded result into. |
| part | part of the Message to decode |
Definition at line 127 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_encode | ( | Bitset * | bits, |
| const google::protobuf::Message & | msg, | ||
| MessagePart | part, | ||
| bool | strict | ||
| ) |
Encode this part (body or head) of the base message.
| bits | pointer to a Bitset where all bits will be pushed on to the most significant end. |
| msg | DCCL Message to encode |
| part | Part of the message to encode |
Definition at line 35 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_hash | ( | std::size_t * | hash, |
| const google::protobuf::Descriptor * | desc, | ||
| MessagePart | part | ||
| ) |
Provide a hash of the DCCL message definition to detect changes in the DCCL message.
| hash | Hash value of this message part |
| desc | Descriptor to validate. Use google::protobuf::Message::GetDescriptor() or MyProtobufType::descriptor() to get this object. |
| part | part of the Message |
Definition at line 387 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_info | ( | std::ostream * | os, |
| const google::protobuf::Descriptor * | desc, | ||
| MessagePart | part | ||
| ) |
Get human readable information (size of fields, etc.) about this part of the DCCL message.
| os | Pointer to stream to store this information |
| desc | Descriptor to get information on. Use google::protobuf::Message::GetDescriptor() or MyProtobufType::descriptor() to get this object. |
| part | the part of the Message to act on. |
Definition at line 307 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_max_size | ( | unsigned * | bit_size, |
| const google::protobuf::Descriptor * | desc, | ||
| MessagePart | part | ||
| ) |
Calculate the maximum size of a message given its Descriptor alone (no data)
| bit_size | Pointer to unsigned integer to store calculated maximum size in bits. |
| desc | Descriptor to calculate the maximum size of. Use google::protobuf::Message::GetDescriptor() or MyProtobufType::descriptor() to get this object. |
| part | part of the Message |
Definition at line 223 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_min_size | ( | unsigned * | bit_size, |
| const google::protobuf::Descriptor * | desc, | ||
| MessagePart | part | ||
| ) |
Calculate the minimum size of a message given its Descriptor alone (no data)
| bit_size | Pointer to unsigned integer to store calculated minimum size in bits. |
| desc | Descriptor to calculate the minimum size of. Use google::protobuf::Message::GetDescriptor() or MyProtobufType::descriptor() to get this object. |
| part | part of the Message |
Definition at line 249 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_size | ( | unsigned * | bit_size, |
| const google::protobuf::Message & | msg, | ||
| MessagePart | part | ||
| ) |
Calculate the size (in bits) of a part of the base message when it is encoded.
| bit_size | Pointer to unsigned integer to store the result. |
| msg | the DCCL Message of which to calculate the size |
| part | part of the Message to calculate the size of |
Definition at line 94 of file field_codec.cpp.
| void dccl::FieldCodecBase::base_validate | ( | const google::protobuf::Descriptor * | desc, |
| MessagePart | part | ||
| ) |
Validate this part of the message to make sure all required extensions are set.
| desc | Descriptor to validate. Use google::protobuf::Message::GetDescriptor() or MyProtobufType::descriptor() to get this object. |
| part | part of the Message |
Definition at line 277 of file field_codec.cpp.
|
protected |
Definition at line 587 of file field_codec.cpp.
| std::string dccl::FieldCodecBase::codec_group | ( | ) |
Definition at line 749 of file field_codec.cpp.
|
static |
Definition at line 444 of file field_codec.cpp.
| int dccl::FieldCodecBase::codec_version | ( | ) |
Definition at line 744 of file field_codec.cpp.
|
inline |
Get the DCCL field option extension value for the current field.
dccl::DCCLFieldOptions is defined in acomms_option_extensions.proto
Definition at line 340 of file field_codec.h.
| dccl::DynamicConditions & dccl::FieldCodecBase::dynamic_conditions | ( | const google::protobuf::FieldDescriptor * | field | ) |
Definition at line 752 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_decode | ( | Bitset * | bits, |
| dccl::any * | field_value, | ||
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Decode a non-repeated field.
| bits | Bits to decode. Used bits are consumed (erased) from the least significant end |
| field_value | Location to store decoded value (FieldType) |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 140 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_decode_repeated | ( | Bitset * | bits, |
| std::vector< dccl::any > * | field_values, | ||
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Decode a repeated field.
| bits | Bits to decode. Used bits are consumed (erased) from the least significant end |
| field_values | Location to store decoded values (FieldType) |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 193 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_encode | ( | Bitset * | bits, |
| const dccl::any & | field_value, | ||
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Encode a non-repeated field.
| bits | Pointer to bitset to store encoded bits. Bits are added to the most significant end of bits |
| field_value | Value to encode (FieldType) |
| field | Protobuf descriptor to the field to encode. Set to 0 for base message. |
Definition at line 48 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_encode_repeated | ( | Bitset * | bits, |
| const std::vector< dccl::any > & | field_values, | ||
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Encode a repeated field.
| bits | Pointer to bitset to store encoded bits. Bits are added to the most significant end of bits |
| field_values | Values to encode (FieldType) |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 79 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_hash | ( | std::size_t * | hash, |
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Provide a hash for this field definition.
| hash | Hash value of this field |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 401 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_info | ( | std::ostream * | os, |
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Write human readable information about the field and its bounds to the provided stream.
| os | Stream to write info to. |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 321 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_max_size | ( | unsigned * | bit_size, |
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Calculate the upper bound on this field's size (in bits)
| bit_size | Location to add calculated maximum bit size to. Be sure to zero bit_size if you want only the size of this field. |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 238 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_min_size | ( | unsigned * | bit_size, |
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Calculate the lower bound on this field's size (in bits)
| bit_size | Location to add calculated minimum bit size to. Be sure to zero bit_size if you want only the size of this field. |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 265 of file field_codec.cpp.
|
inline |
Post-decodes a non-repeated (i.e. optional or required) field by converting the WireType (the type used in the encoded DCCL message) representation into the FieldType representation (the Google Protobuf representation). This allows for type-converting codecs.
| wire_value | Should be set to the desired value to translate |
| field_value | Will be set to the converted wire_value |
Definition at line 289 of file field_codec.h.
|
inline |
Post-decodes a repeated field.
| wire_values | Should be set to the desired values to translate |
| field_values | Will be set to the converted wire_values |
Definition at line 298 of file field_codec.h.
|
inline |
Pre-encodes a non-repeated (i.e. optional or required) field by converting the FieldType representation (the Google Protobuf representation) into the WireType representation (the type used in the encoded DCCL message). This allows for type-converting codecs.
These are called typically by DefaultMessageCodec to start processing a new field. In this example "bar" and "baz" are fields:
| wire_value | Will be set to the converted field_value |
| field_value | Value to convert to the appropriate wire_value |
Definition at line 219 of file field_codec.h.
|
inline |
Pre-encodes a repeated field.
| wire_values | Should be set to the converted field_values |
| field_values | Values to convert to the appropriate wire_values |
Definition at line 228 of file field_codec.h.
| void dccl::FieldCodecBase::field_size | ( | unsigned * | bit_size, |
| const dccl::any & | field_value, | ||
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Calculate the size of a field.
| bit_size | Location to add calculated bit size to. Be sure to zero bit_size if you want only the size of this field. |
| field_value | Value calculate size of (FieldType) |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 104 of file field_codec.cpp.
| void dccl::FieldCodecBase::field_size_repeated | ( | unsigned * | bit_size, |
| const std::vector< dccl::any > & | field_values, | ||
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Calculate the size of a repeated field.
| bit_size | Location to add calculated bit size to. Be sure to zero bit_size if you want only the size of this field. |
| field_values | Values to calculate size of (FieldType) |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
Definition at line 115 of file field_codec.cpp.
|
inline |
the type exposed to the user in the original and decoded Protobuf messages
Definition at line 69 of file field_codec.h.
| void dccl::FieldCodecBase::field_validate | ( | bool * | b, |
| const google::protobuf::FieldDescriptor * | field | ||
| ) |
Validate this field, checking that all required option extensions are set (e.g. (dccl.field).max and (dccl.field).min for arithmetic codecs)
| b | Currently unused (will be set to false) |
| field | Protobuf descriptor to the field. Set to 0 for base message. |
| Exception | If field is invalid |
Definition at line 291 of file field_codec.cpp.
| bool dccl::FieldCodecBase::has_codec_group | ( | ) |
Definition at line 728 of file field_codec.cpp.
|
inlineprotectedvirtual |
Generate a field specific hash to be combined with the descriptor hash.
Reimplemented in dccl::v3::DefaultEnumCodec.
Definition at line 466 of file field_codec.h.
|
protectedvirtual |
Write field specific information (in addition to general information such as sizes that are automatically written by this class for all fields.
Definition at line 456 of file field_codec.cpp.
|
inline |
Definition at line 371 of file field_codec.h.
|
inline |
Definition at line 379 of file field_codec.h.
|
protectedpure virtual |
Calculate maximum size of the field in bits.
Implemented in dccl::v2::DefaultBytesCodec, dccl::v3::DefaultStringCodec, dccl::v3::PresenceBitCodec< WrappedType >, dccl::v3::VarBytesCodec, dccl::TypedFixedFieldCodec< WireType, FieldType >, dccl::TypedFixedFieldCodec< bool >, dccl::TypedFixedFieldCodec< CustomMsg >, dccl::TypedFixedFieldCodec< dccl::uint32 >, dccl::TypedFixedFieldCodec< dccl::uint32, dccl::uint32 >, dccl::TypedFixedFieldCodec< dccl::uint64 >, dccl::TypedFixedFieldCodec< double >, dccl::TypedFixedFieldCodec< float >, dccl::TypedFixedFieldCodec< int32, const google::protobuf::EnumValueDescriptor * >, dccl::TypedFixedFieldCodec< protobuf::CCLMDATState::GFIPitchOil >, dccl::TypedFixedFieldCodec< T >, dccl::TypedFixedFieldCodec< time_wire_type, double >, dccl::TypedFixedFieldCodec< time_wire_type, int64 >, dccl::TypedFixedFieldCodec< time_wire_type, TimeType >, dccl::TypedFixedFieldCodec< time_wire_type, uint64 >, dccl::TypedFixedFieldCodec< WireType, WireType >, dccl::DefaultIdentifierCodec, dccl::RepeatedTypedFieldCodec< WireType, FieldType >, dccl::RepeatedTypedFieldCodec< dccl::int32 >, dccl::RepeatedTypedFieldCodec< Model::value_type, const google::protobuf::EnumValueDescriptor * >, dccl::RepeatedTypedFieldCodec< Model::value_type, FieldType >, and dccl::RepeatedTypedFieldCodec< Model::value_type, Model::value_type >.
|
protectedvirtual |
Reimplemented in dccl::arith::ArithmeticFieldCodecBase< const google::protobuf::EnumValueDescriptor * >, dccl::arith::ArithmeticFieldCodecBase< FieldType >, dccl::arith::ArithmeticFieldCodecBase< FieldType >, dccl::RepeatedTypedFieldCodec< WireType, FieldType >, dccl::RepeatedTypedFieldCodec< dccl::int32 >, dccl::RepeatedTypedFieldCodec< Model::value_type, const google::protobuf::EnumValueDescriptor * >, dccl::RepeatedTypedFieldCodec< Model::value_type, FieldType >, and dccl::RepeatedTypedFieldCodec< Model::value_type, Model::value_type >.
Definition at line 603 of file field_codec.cpp.
| dccl::internal::MessageStackData & dccl::FieldCodecBase::message_data | ( | ) |
Definition at line 719 of file field_codec.cpp.
| const dccl::internal::MessageStackData & dccl::FieldCodecBase::message_data | ( | ) | const |
Definition at line 724 of file field_codec.cpp.
|
protectedpure virtual |
Calculate minimum size of the field in bits.
Implemented in dccl::v2::DefaultBytesCodec, dccl::v3::DefaultStringCodec, dccl::v3::PresenceBitCodec< WrappedType >, dccl::v3::VarBytesCodec, dccl::TypedFixedFieldCodec< WireType, FieldType >, dccl::TypedFixedFieldCodec< bool >, dccl::TypedFixedFieldCodec< CustomMsg >, dccl::TypedFixedFieldCodec< dccl::uint32 >, dccl::TypedFixedFieldCodec< dccl::uint32, dccl::uint32 >, dccl::TypedFixedFieldCodec< dccl::uint64 >, dccl::TypedFixedFieldCodec< double >, dccl::TypedFixedFieldCodec< float >, dccl::TypedFixedFieldCodec< int32, const google::protobuf::EnumValueDescriptor * >, dccl::TypedFixedFieldCodec< protobuf::CCLMDATState::GFIPitchOil >, dccl::TypedFixedFieldCodec< T >, dccl::TypedFixedFieldCodec< time_wire_type, double >, dccl::TypedFixedFieldCodec< time_wire_type, int64 >, dccl::TypedFixedFieldCodec< time_wire_type, TimeType >, dccl::TypedFixedFieldCodec< time_wire_type, uint64 >, dccl::TypedFixedFieldCodec< WireType, WireType >, dccl::DefaultIdentifierCodec, dccl::RepeatedTypedFieldCodec< WireType, FieldType >, dccl::RepeatedTypedFieldCodec< dccl::int32 >, dccl::RepeatedTypedFieldCodec< Model::value_type, const google::protobuf::EnumValueDescriptor * >, dccl::RepeatedTypedFieldCodec< Model::value_type, FieldType >, and dccl::RepeatedTypedFieldCodec< Model::value_type, Model::value_type >.
|
protectedvirtual |
Reimplemented in dccl::arith::ArithmeticFieldCodecBase< const google::protobuf::EnumValueDescriptor * >, dccl::arith::ArithmeticFieldCodecBase< FieldType >, dccl::arith::ArithmeticFieldCodecBase< FieldType >, dccl::RepeatedTypedFieldCodec< WireType, FieldType >, dccl::RepeatedTypedFieldCodec< dccl::int32 >, dccl::RepeatedTypedFieldCodec< Model::value_type, const google::protobuf::EnumValueDescriptor * >, dccl::RepeatedTypedFieldCodec< Model::value_type, FieldType >, and dccl::RepeatedTypedFieldCodec< Model::value_type, Model::value_type >.
Definition at line 615 of file field_codec.cpp.
|
inline |
the name of the codec used to identifier it in the .proto custom option extension
Definition at line 65 of file field_codec.h.
| dccl::MessagePart dccl::FieldCodecBase::part | ( | ) |
the part of the message currently being encoded (head or body)
Definition at line 740 of file field_codec.cpp.
|
inline |
Essentially an assertion to be used in the validate() virtual method.
| b | Boolean to assert (if true, execution continues, if false an exception is thrown) |
| description | Debugging description for this assertion (will be appended to the exception) |
| Exception | Thrown if !b |
Definition at line 354 of file field_codec.h.
| const dccl::Bitset * dccl::FieldCodecBase::root_bitset | ( | ) | const |
Returns the root Bitset for the current encode or decode operation.
During encoding: points to the Bitset accumulating all body bits so far (before this field). During decoding: points to a copy of the full Bitset taken at the start of base_decode(). Returns nullptr if called outside of an encode/decode context.
Definition at line 714 of file field_codec.cpp.
| const google::protobuf::Descriptor * dccl::FieldCodecBase::root_descriptor | ( | ) | const |
Definition at line 709 of file field_codec.cpp.
| const google::protobuf::Message * dccl::FieldCodecBase::root_message | ( | ) |
Definition at line 704 of file field_codec.cpp.
|
inline |
Force the codec to always use the "required" field encoding, regardless of the FieldDescriptor setting. Useful when wrapping this codec in another that handles optional and repeated fields.
Definition at line 128 of file field_codec.h.
|
inlinevirtual |
Definition at line 387 of file field_codec.h.
| bool dccl::FieldCodecBase::strict | ( | ) |
Definition at line 742 of file field_codec.cpp.
| const google::protobuf::Descriptor * dccl::FieldCodecBase::this_descriptor | ( | ) | const |
Returns the Descriptor (message schema meta-data) for the immediate parent Message.
for:
returns Descriptor for Foo if this_field() == 0 returns Descriptor for Foo if this_field() == FieldDescriptor for bar returns Descriptor for FooBar if this_field() == FieldDescriptor for baz
Definition at line 694 of file field_codec.cpp.
| const google::protobuf::FieldDescriptor * dccl::FieldCodecBase::this_field | ( | ) | const |
Returns the FieldDescriptor (field schema meta-data) for this field.
Definition at line 689 of file field_codec.cpp.
| const google::protobuf::Message * dccl::FieldCodecBase::this_message | ( | ) |
Definition at line 699 of file field_codec.cpp.
|
inlineprotected |
Whether to use the required or optional encoding.
Definition at line 391 of file field_codec.h.
|
inlineprotectedvirtual |
Validate a field. Use require() inside your overloaded validate() to assert requirements or throw Exceptions directly as needed.
Reimplemented in dccl::arith::ArithmeticFieldCodecBase< const google::protobuf::EnumValueDescriptor * >, dccl::arith::ArithmeticFieldCodecBase< FieldType >, dccl::arith::ArithmeticFieldCodecBase< FieldType >, dccl::v2::DefaultNumericFieldCodec< WireType, FieldType >, dccl::v2::DefaultNumericFieldCodec< dccl::uint32 >, dccl::v2::DefaultNumericFieldCodec< int32, const google::protobuf::EnumValueDescriptor * >, dccl::v2::DefaultNumericFieldCodec< time_wire_type, double >, dccl::v2::DefaultNumericFieldCodec< time_wire_type, int64 >, dccl::v2::DefaultNumericFieldCodec< time_wire_type, TimeType >, dccl::v2::DefaultNumericFieldCodec< time_wire_type, uint64 >, dccl::v2::DefaultBoolCodec, dccl::v2::DefaultBytesCodec, dccl::v3::DefaultEnumCodec, dccl::v3::DefaultStringCodec, dccl::v3::PresenceBitCodec< WrappedType >, dccl::v3::VarBytesCodec, dccl::v5::DefaultNumericFieldCodec< WireType, FieldType >, and dccl::DefaultIdentifierCodec.
Definition at line 458 of file field_codec.h.
|
inline |
the C++ type used "on the wire". This is the type visible after pre_encode and before post_decode functions are called.
The wire type allows codecs to make type changes (e.g. from string to integer) before reusing another codec that knows how to encode that wire type (e.g. DefaultNumericFieldCodec)
Definition at line 74 of file field_codec.h.
|
friend |
Definition at line 531 of file field_codec.h.
|
friend |
Definition at line 492 of file field_codec.h.