DCCL v4
|
A class for managing the various field codecs. Here you can add and remove field codecs. The DCCL Codec and DefaultMessageCodec use the find() methods to locate the appropriate field codec. More...
#include <dccl/field_codec_manager.h>
Public Member Functions | |
template<class Codec > | |
std::enable_if< std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value, void >::type | add (const std::string &name) |
Add a new field codec (used for codecs operating on statically generated Protobuf messages, that is, children of google::protobuf::Message but not google::protobuf::Message itself). | |
template<class Codec > | |
std::enable_if<!(std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value), void >::type | add (const std::string &name) |
Add a new field codec (used for codecs operating on all types except statically generated Protobuf messages). | |
template<class Codec , google::protobuf::FieldDescriptor::Type type> | |
void | add (const std::string &name) |
Add a new field codec only valid for a specific google::protobuf::FieldDescriptor::Type. This is useful if a given codec is designed to work with only a specific Protobuf type that shares an underlying C++ type (e.g. Protobuf types bytes and string ) | |
template<class Codec > | |
std::enable_if< std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value, void >::type | remove (const std::string &name) |
Remove a new field codec (used for codecs operating on statically generated Protobuf messages, that is, children of google::protobuf::Message but not google::protobuf::Message itself). | |
template<class Codec > | |
std::enable_if<!(std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value), void >::type | remove (const std::string &name) |
Remove a new field codec (used for codecs operating on all types except statically generated Protobuf messages). | |
template<class Codec , google::protobuf::FieldDescriptor::Type type> | |
void | remove (const std::string &name) |
Remove a new field codec only valid for a specific google::protobuf::FieldDescriptor::Type. This is useful if a given codec is designed to work with only a specific Protobuf type that shares an underlying C++ type (e.g. Protobuf types bytes and string ) | |
std::shared_ptr< FieldCodecBase > | find (const google::protobuf::FieldDescriptor *field, int codec_version, bool has_codec_group, const std::string &codec_group) const |
Find the codec for a given field. For embedded messages, prefers (dccl.field).codec (inside field) over (dccl.msg).codec (inside embedded message). | |
std::shared_ptr< FieldCodecBase > | find (const google::protobuf::Descriptor *desc, int codec_version=0, std::string name="") const |
Find the codec for a given base (or embedded) message. | |
std::shared_ptr< FieldCodecBase > | find (google::protobuf::FieldDescriptor::Type type, int codec_version, std::string name) const |
void | clear () |
internal::TypeHelper & | type_helper () |
const internal::TypeHelper & | type_helper () const |
internal::CodecData & | codec_data () |
const internal::CodecData & | codec_data () const |
void | set_hash (const google::protobuf::Descriptor *desc, std::size_t hash) |
bool | has_hash (const google::protobuf::Descriptor *desc) const |
std::size_t | hash (const google::protobuf::Descriptor *desc) const |
A class for managing the various field codecs. Here you can add and remove field codecs. The DCCL Codec and DefaultMessageCodec use the find() methods to locate the appropriate field codec.
Definition at line 39 of file field_codec_manager.h.
dccl::FieldCodecManagerLocal::FieldCodecManagerLocal | ( | ) |
Definition at line 26 of file field_codec_manager.cpp.
std::enable_if<!(std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value), void >::type dccl::FieldCodecManagerLocal::add | ( | const std::string & | name | ) |
Add a new field codec (used for codecs operating on statically generated Protobuf messages, that is, children of google::protobuf::Message but not google::protobuf::Message itself).
Codec | A child of FieldCodecBase |
name | Name to use for this codec. Corresponds to (dccl.field).codec="name" in .proto file. |
Definition at line 313 of file field_codec_manager.h.
std::enable_if<!(std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value), void >::type dccl::FieldCodecManagerLocal::add | ( | const std::string & | name | ) |
Add a new field codec (used for codecs operating on all types except statically generated Protobuf messages).
Codec | A child of FieldCodecBase |
name | Name to use for this codec. Corresponds to (dccl.field).codec="name" in .proto file. |
void dccl::FieldCodecManagerLocal::add | ( | const std::string & | name | ) |
Add a new field codec only valid for a specific google::protobuf::FieldDescriptor::Type. This is useful if a given codec is designed to work with only a specific Protobuf type that shares an underlying C++ type (e.g. Protobuf types bytes
and string
)
Codec | A child of FieldCodecBase |
type | The google::protobuf::FieldDescriptor::Type enumeration that this codec works on. |
name | Name to use for this codec. Corresponds to (dccl.field).codec="name" in .proto file. |
Definition at line 332 of file field_codec_manager.h.
|
inline |
Definition at line 154 of file field_codec_manager.h.
|
inline |
Definition at line 163 of file field_codec_manager.h.
|
inline |
Definition at line 164 of file field_codec_manager.h.
|
inline |
Find the codec for a given base (or embedded) message.
desc | Message descriptor to find codec for |
name | Codec name (used for embedded messages to prefer the codec listed as a field option). Omit for finding the codec of a base message (one that is not embedded). |
Definition at line 130 of file field_codec_manager.h.
|
inline |
Find the codec for a given field. For embedded messages, prefers (dccl.field).codec (inside field) over (dccl.msg).codec (inside embedded message).
Definition at line 114 of file field_codec_manager.h.
|
inline |
Definition at line 148 of file field_codec_manager.h.
|
inline |
Definition at line 170 of file field_codec_manager.h.
|
inline |
Definition at line 171 of file field_codec_manager.h.
std::enable_if<!(std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value), void >::type dccl::FieldCodecManagerLocal::remove | ( | const std::string & | name | ) |
Remove a new field codec (used for codecs operating on statically generated Protobuf messages, that is, children of google::protobuf::Message but not google::protobuf::Message itself).
Codec | A child of FieldCodecBase |
name | Name to use for this codec. Corresponds to (dccl.field).codec="name" in .proto file. |
Definition at line 385 of file field_codec_manager.h.
std::enable_if<!(std::is_base_of< google::protobuf::Message, typenameCodec::wire_type >::value &&!std::is_same< google::protobuf::Message, typenameCodec::wire_type >::value), void >::type dccl::FieldCodecManagerLocal::remove | ( | const std::string & | name | ) |
Remove a new field codec (used for codecs operating on all types except statically generated Protobuf messages).
Codec | A child of FieldCodecBase |
name | Name to use for this codec. Corresponds to (dccl.field).codec="name" in .proto file. |
void dccl::FieldCodecManagerLocal::remove | ( | const std::string & | name | ) |
Remove a new field codec only valid for a specific google::protobuf::FieldDescriptor::Type. This is useful if a given codec is designed to work with only a specific Protobuf type that shares an underlying C++ type (e.g. Protobuf types bytes
and string
)
Codec | A child of FieldCodecBase |
type | The google::protobuf::FieldDescriptor::Type enumeration that this codec works on. |
name | Name to use for this codec. Corresponds to (dccl.field).codec="name" in .proto file. |
Definition at line 404 of file field_codec_manager.h.
|
inline |
Definition at line 166 of file field_codec_manager.h.
|
inline |
Definition at line 160 of file field_codec_manager.h.
|
inline |
Definition at line 161 of file field_codec_manager.h.