Learn R Programming

RProtoBuf (version 0.4.22)

clear-methods: Clear a field or all fields of the message and set them to their default values

Description

Clear one field or all fields of the message and set them to their default values

Arguments

Methods

signature(object = "Message", field = "missing")

Clear all fields of the message and set them to their default values

signature(object = "Message", field = "character")

Clear the field identified by its name

signature(object = "Message", field = "integer")

Clear the field identified by its tag number

signature(object = "Message", field = "numeric")

Clear the field identified by its tag number

signature(object = "Message", field = "raw")

Clear the field identified by its tag number

Examples

Run this code
	message <- new( tutorial.Person, name = "dddd", email = "eeeeeee", id = 1 )
	writeLines( as.character( message ) )
	clear( message )
	# clear works also as a pseudo method :
	message$clear() 
	
	writeLines( as.character( message ) )
	
	# clear single fields
	message <- new( tutorial.Person, name = "dddd", email = "eeeeeee", id = 1 )
	message$clear( "name" )
	writeLines( as.character( message ) )
	

Run the code above in your browser using DataLab