| EnumValueDescriptor-class {RProtoBuf} | R Documentation |
Class "EnumValueDescriptor"
Description
R representation of an enum value descriptor. This
is a thin wrapper around the EnumValueDescriptor c++ class.
Objects from the Class
Objects of this class are typically retrieved with the
value method of the EnumDescriptor class
Slots
pointer:external pointer to the
EnumValueDescriptorinstancename:simple name of the enum
full_name:fully qualified name
Methods
- show
signature(object = "EnumValueDescriptor"): small information- as.character
signature(x = "EnumValueDescriptor"): returns the debug string of the enum descriptor. This is retrieved by a call to theDebugStringmethod of the EnumDescriptor object.- toString
signature(x = "EnumValueDescriptor"): same asas.character- $
signature(x = "EnumValueDescriptor"): invoke pseudo methods- name
signature(object = "EnumValueDescriptor", full = "logical"): return the name of this enum constant.- number
signature(object = "EnumValueDescriptor"): return the numeric value of this enum constant.- enum_type
signature(object = "EnumDescriptor"): retrieves the EnumDescriptor related to this value descriptor.
Author(s)
Romain Francois <francoisromain@free.fr>
Examples
## 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)
# enum type
Person$PhoneType
# enum value type
value(Person$PhoneType, 1)
name(value(Person$PhoneType, 1))
name(value(Person$PhoneType, 1), TRUE)
number(value(Person$PhoneType, number=1))
enum_type(value(Person$PhoneType, number=1))