FieldDescriptor-class | R Documentation |
R representation of message type field descriptor.
This is a thin wrapper around the C++ class FieldDescriptor
Objects typically are retrieved from FieldDescriptor
pointer
:external pointer to the FieldDescriptor
c++ object
name
:name of the field within the message type
full_name
:Fully qualified name of the field
type
:Fully qualified name of the type that contains this field
signature(object = "FieldDescriptor")
: small description
signature(x = "FieldDescriptor")
:
returns the debug string of the field descriptor.
This is retrieved by a call to the DebugString
method of the FieldDescriptor object.
signature(x = "FieldDescriptor")
: same as as.character
signature(x = "FieldDescriptor")
: used to invoke pseudo methods
signature(object = "FieldDescriptor")
: returns a Descriptor of the message type that contains this field descriptor.
signature(object = "FieldDescriptor")
: indicates if this is an extension.
signature(object = "FieldDescriptor")
: gets the declared tag number of this field.
signature(object = "FieldDescriptor")
: type of this field.
signature(object = "FieldDescriptor")
: c++ type of this field.
signature(object = "FieldDescriptor")
: label of this field.
signature(object = "FieldDescriptor")
: is this field required.
signature(object = "FieldDescriptor")
: is this field optional.
signature(object = "FieldDescriptor")
: is this field repeated.
signature(object = "FieldDescriptor")
: indicates if this field has a default value.
signature(object = "FieldDescriptor")
: the default value of this field.
signature(object = "FieldDescriptor")
: the Descriptor for the associated message type. Generates an error if this field is not a message type field.
signature(object = "FieldDescriptor")
: the EnumDescriptor for the associated enum type.Generates an error if this field is not an enum type field
Romain Francois <francoisromain@free.fr>
The FieldDescriptor
C++ class
Descriptor
## Not run:
# example proto file supplied with this package
proto.file <- system.file( "proto", "addressbook.proto", package = "RProtoBuf" )
# reading a proto file and creating the descriptor
Person <- P( "tutorial.Person", file = proto.file )
## End(Not run)
# field descriptor object
Person$email
# debug string
as.character( Person$email )
# or as a pseudo method
Person$email$as.character()
Person$email$is_required()
Person$email$is_optional()
Person$email$is_repeated()
Person$email$has_default_value()
Person$email$default_value()
Person$email$is_extension()
# Get the default values
has_default_value(Person$id)
has_default_value(Person$email)
has_default_value(Person$phone)
default_value(Person$id)
default_value(Person$email)
default_value(Person$phone)
# Get the types of field descriptors
type(Person$id)
type(Person$id, as.string=TRUE)
cpp_type(Person$email)
cpp_type(Person$email, TRUE)
# Get the label of a field descriptor
label(Person$id)
label(Person$email)
label(Person$phone)
label(Person$id, TRUE)
label(Person$email, TRUE)
label(Person$phone, TRUE)
LABEL_OPTIONAL
LABEL_REQUIRED
LABEL_REPEATED
# Test if a field is optional
is_optional(Person$id)
is_optional(Person$email)
is_optional(Person$phone)
# Test if a field is repeated
is_repeated(Person$id)
is_repeated(Person$email)
is_repeated(Person$phone)
# Test if a field is required
is_required(Person$id)
is_required(Person$email)
is_required(Person$phone)
# Return the class of a message field
message_type(Person$phone)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.