RProtoBuf (version 0.4.11)

as.list.Message: Grab the protocol buffer message as an R list

Description

Utility to grab the protocol buffer message as an R list, with one item per field.

Usage

# S3 method for Message
as.list(x, ...)
# S3 method for Descriptor
as.list(x, ...)
# S3 method for EnumDescriptor
as.list(x, ...)
# S3 method for FileDescriptor
as.list(x, ...)
# S3 method for ServiceDescriptor
as.list(x, ...)

Arguments

x

A protocol buffer message, instance of '>Message, or a protocol message descriptor, instance of '>Descriptor

ignored

Value

For messages, a list of the content of the fields is returned.

For message type descriptors, a list containing nested type descriptors ('>Descriptor objects), enum type descriptors ('>EnumDescriptor objects), then field descriptors ('>FieldDescriptor objects) in that order.

For enum descriptors, a named list of the enumerated values.

For file descriptors, a named list of descriptors defined in the specified file descriptor.

For service descriptors, ...

Examples

Run this code
# NOT RUN {
Person <- P( "tutorial.Person" )
romain <- new( Person, email = "francoisromain@free.fr", id = 1 )
as.list( romain )
as.list( Person )
as.list( Person$PhoneType)
# }

Run the code above in your browser using DataCamp Workspace