Package it.polito.appeal.traci.protocol
Class Command
java.lang.Object
it.polito.appeal.traci.protocol.Command
Represents a single TraCI command, with its identifier and content. It can
 be used either as a request (i.e. from client to server) and as a response
 (i.e. from server to client). The "command" term reflects the description
 in the wiki.
 Each command is characterized by a type identifier and a variable-sized
 content. The command can be constructed either from a data block (a
 
Storage) or from scratch; its content can be read or written to a
 Storage.- Author:
- Enrico Gueli <enrico.gueli@polito.it>
- See Also:
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
CommandBuilds a command from aStoragereceived from the other endpoint.Note that this will advance the storage's internal pointer to the next data. - Parameters:
- rawStorage- raw storage
 
- 
Commandpublic Command(int id) Creates a command with a given identifier and an empty content.- Parameters:
- id- id
 
 
- 
- 
Method Details- 
idpublic int id()Returns the type identifier.- Returns:
- the id
 
- 
contentReturns the content.- Returns:
- the content
 
- 
writeRawToWrites the serialized form of this command to the givenStorageobject.Note: this will advance the internal pointer of the given storage. - Parameters:
- out- output
 
- 
rawSizepublic int rawSize()Returns the expected size of the serialized form of this command.- Returns:
- raw size
 
 
-