Class MessageBuffer
Message buffer class
Metamethods
MessageBuffer:__init ([max_backlog]) | Message buffer constructor. |
Methods
MessageBuffer:cdata () | Access underlying data structure |
MessageBuffer:getCount () | Get the number of messages in the buffer. |
MessageBuffer:clear () | Clear the buffer and discard all messages |
MessageBuffer:read (Timeout[, result_msg[, result_header]]) | Get the next message from buffer |
Metamethods
- MessageBuffer:__init ([max_backlog])
-
Message buffer constructor.
Parameters:
- max_backlog int Maximum buffer size, if not provided, buffer size is unlimited (optional)
Returns:
-
MessageBuffer
The constructed object
Methods
- MessageBuffer:cdata ()
-
Access underlying data structure
Returns:
-
The data structure
- MessageBuffer:getCount ()
-
Get the number of messages in the buffer.
Returns:
-
int
Number of messages
- MessageBuffer:clear ()
- Clear the buffer and discard all messages
- MessageBuffer:read (Timeout[, result_msg[, result_header]])
-
Get the next message from buffer
Parameters:
- Timeout int to wait for next message if the buffer is empty
- result_msg torch.ByteStorage If present, this object is used to store the message data, otherwise the required memory is allocated by this function (optional)
- result_header std.StringMap If present, this object is used to store the message header, otherwise the required memory is allocated by this function (optional)
Returns:
- torch.ByteStorage result_msg The message data
- std.StringMap The message header data