EnumDescriptor-class | R Documentation |
R representation of an enum descriptor. This
is a thin wrapper around the EnumDescriptor
c++ class.
Objects of this class are typically retrieved as members of Descriptor objects
pointer
:external pointer to the EnumDescriptor
instance
name
:simple name of the enum
full_name
:fully qualified name
type
:fully qualified name of the type that contains this enumeration
signature(object = "EnumDescriptor")
: small information
signature(x = "EnumDescriptor")
:
returns the debug string of the enum descriptor.
This is retrieved by a call to the DebugString
method of the EnumDescriptor object.
signature(x = "EnumDescriptor")
: same as as.character
signature(x = "EnumDescriptor")
: get the
number associated with the name
signature(object = "EnumDescriptor")
: indicate if
the given name is a constant present in this enum.
signature(object = "EnumDescriptor")
: returns a Descriptor of the message type that contains this enum descriptor, or NULL if this is a top level enum descriptor.
signature(x = "EnumDescriptor")
: number of constants in this enum.
signature(object = "EnumDescriptor")
: number of constants in this enum.
signature(object = "EnumDescriptor")
: extracts an EnumValueDescriptor.
Exactly one argument of index
, number
or name
has to be
used.
If index
is used, the enum value descriptor is retrieved
by position, using the value
method of the C++ class.
If number
is used, the enum value descriptor is retrieved
using the value of the constant, using the FindValueByNumber
C++ method.
If name
is used, the enum value descriptor is retrieved
using the name of the constant, using the FindValueByName
C++ method.
signature(x = "EnumDescriptor")
: extracts field identified by its name or declared tag number
signature(x = "EnumDescriptor")
: extracts names of this enum
Romain Francois <francoisromain@free.fr>
The EnumDescriptor
C++ class
The Descriptor class
## 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
has(Person$PhoneType, "MOBILE")
has(Person$PhoneType, "HOME")
has(Person$PhoneType, "WORK")
has(Person$PhoneType, "FOOBAR")
length(Person$PhoneType)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.