Learn R Programming

RProtoBuf (version 0.3.2)

EnumValueDescriptor-class: Class "EnumValueDescriptor"

Description

R representation of an enum value descriptor. This is a thin wrapper around the EnumValueDescriptor c++ class.

Arguments

Objects from the Class

Objects of this class are typically retrieved with the value method of the EnumDescriptor class

References

The EnumValueDescriptor C++ class. http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.descriptor.html#EnumValueDescriptor

Examples

Run this code
# 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 )
Person <- P( "tutorial.Person" )
# 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))

Run the code above in your browser using DataLab