DCCL v5
Loading...
Searching...
No Matches
dccl::internal::FromProtoCppTypeBase Class Reference

Provides various representations of a google::protobuf::FieldDescriptor::CppType enumeration, and ways to access the google::protobuf::Reflection object for a given type. More...

#include <dccl/internal/protobuf_cpp_type_helpers.h>

Inheritance diagram for dccl::internal::FromProtoCppTypeBase:

Public Member Functions

virtual std::string as_str ()
 string representation
dccl::any get_value (const google::protobuf::FieldDescriptor *field, const google::protobuf::Message &msg)
 Get a given field's value from the provided message.
dccl::any get_value (const google::protobuf::Message &msg)
 Get the value of the entire base message (only works for CPPTYPE_MESSAGE).
dccl::any get_repeated_value (const google::protobuf::FieldDescriptor *field, const google::protobuf::Message &msg, int index)
 Get the value of a repeated field at a given index.
void set_value (const google::protobuf::FieldDescriptor *field, google::protobuf::Message *msg, dccl::any value)
 Set a given field's value in the provided message.
void set_value (google::protobuf::Message *msg, dccl::any value)
 Set the value of the entire base message (only works for CPPTYPE_MESSAGE).
void add_value (const google::protobuf::FieldDescriptor *field, google::protobuf::Message *msg, dccl::any value)
 Add a new entry for a repeated field to the back.
virtual void _set_value (const google::protobuf::FieldDescriptor *, google::protobuf::Message *, dccl::any)
virtual void _add_value (const google::protobuf::FieldDescriptor *, google::protobuf::Message *, dccl::any)
virtual dccl::any _get_repeated_value (const google::protobuf::FieldDescriptor *, const google::protobuf::Message &, int)
virtual dccl::any _get_value (const google::protobuf::FieldDescriptor *, const google::protobuf::Message &)

Detailed Description

Provides various representations of a google::protobuf::FieldDescriptor::CppType enumeration, and ways to access the google::protobuf::Reflection object for a given type.

Definition at line 57 of file protobuf_cpp_type_helpers.h.

Member Function Documentation

◆ _add_value()

virtual void dccl::internal::FromProtoCppTypeBase::_add_value ( const google::protobuf::FieldDescriptor * ,
google::protobuf::Message * ,
dccl::any  )
inlinevirtual

Definition at line 142 of file protobuf_cpp_type_helpers.h.

◆ _get_repeated_value()

virtual dccl::any dccl::internal::FromProtoCppTypeBase::_get_repeated_value ( const google::protobuf::FieldDescriptor * ,
const google::protobuf::Message & ,
int  )
inlinevirtual

Definition at line 148 of file protobuf_cpp_type_helpers.h.

◆ _get_value()

virtual dccl::any dccl::internal::FromProtoCppTypeBase::_get_value ( const google::protobuf::FieldDescriptor * ,
const google::protobuf::Message &  )
inlinevirtual

Definition at line 154 of file protobuf_cpp_type_helpers.h.

◆ _set_value()

virtual void dccl::internal::FromProtoCppTypeBase::_set_value ( const google::protobuf::FieldDescriptor * ,
google::protobuf::Message * ,
dccl::any  )
inlinevirtual

Definition at line 136 of file protobuf_cpp_type_helpers.h.

◆ add_value()

void dccl::internal::FromProtoCppTypeBase::add_value ( const google::protobuf::FieldDescriptor * field,
google::protobuf::Message * msg,
dccl::any value )
inline

Add a new entry for a repeated field to the back.

Parameters
fieldField to add value to.
msgMessage to which this field belongs.
valueValue to add.

Definition at line 127 of file protobuf_cpp_type_helpers.h.

◆ as_str()

◆ get_repeated_value()

dccl::any dccl::internal::FromProtoCppTypeBase::get_repeated_value ( const google::protobuf::FieldDescriptor * field,
const google::protobuf::Message & msg,
int index )
inline

Get the value of a repeated field at a given index.

Parameters
fieldField to get value for.
msgMessage to get value from.
indexIndex of the repeated array to get value for.
Returns
dccl::any containing the value. The type is usually the type returned by google::protobuf::Reflection::GetType where Type is the corresponding google::protobuf::FieldDescriptor::CppType. (See http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Reflection).

Definition at line 94 of file protobuf_cpp_type_helpers.h.

◆ get_value() [1/2]

dccl::any dccl::internal::FromProtoCppTypeBase::get_value ( const google::protobuf::FieldDescriptor * field,
const google::protobuf::Message & msg )
inline

Get a given field's value from the provided message.

Parameters
fieldField to get value for.
msgMessage to get value from.
Returns
dccl::any containing the value. The type is usually the type returned by google::protobuf::Reflection::GetType where Type is the corresponding google::protobuf::FieldDescriptor::CppType. (See http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Reflection).

Definition at line 70 of file protobuf_cpp_type_helpers.h.

◆ get_value() [2/2]

dccl::any dccl::internal::FromProtoCppTypeBase::get_value ( const google::protobuf::Message & msg)
inline

Get the value of the entire base message (only works for CPPTYPE_MESSAGE).

Definition at line 86 of file protobuf_cpp_type_helpers.h.

◆ set_value() [1/2]

void dccl::internal::FromProtoCppTypeBase::set_value ( const google::protobuf::FieldDescriptor * field,
google::protobuf::Message * msg,
dccl::any value )
inline

Set a given field's value in the provided message.

Parameters
fieldField to set value for.
msgMessage to set value in.
valuedccl::any containing the value to set. The type is usually the type required by google::protobuf::Reflection::SetType where Type is the corresponding google::protobuf::FieldDescriptor::CppType. (See http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Reflection).

Definition at line 105 of file protobuf_cpp_type_helpers.h.

◆ set_value() [2/2]

void dccl::internal::FromProtoCppTypeBase::set_value ( google::protobuf::Message * msg,
dccl::any value )
inline

Set the value of the entire base message (only works for CPPTYPE_MESSAGE).

Definition at line 115 of file protobuf_cpp_type_helpers.h.


The documentation for this class was generated from the following file: