DCCL v4
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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()

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 122 of file protobuf_cpp_type_helpers.h.

◆ 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::Get<i>Type 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 89 of file protobuf_cpp_type_helpers.h.

◆ get_value()

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::Get<i>Type 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.

◆ set_value()

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::Set<i>Type 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 100 of file protobuf_cpp_type_helpers.h.


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