Class RxStream
Defined in File CBorStream.h
Nested Relationships
Nested Types
Class Documentation
-
class RxStream
Public Functions
-
RxStream(uint8_t stream_type, std::string stream_name, uint8_t stream_identifier)
Create a reception stream.
- Parameters:
stream_type – Type of the object using the current instance
stream_name – Name of the topic or the service to which the communication belongs
stream_identifier – Identifier of the topic or the service read from configuration
-
bool data_available(int64_t sequence_id = 0)
Check if there are data.
A map contains the information received for all topics and services, so using the name saved in the current instance as key it is possible to know if a message is arrived for a specific entity.
- Parameters:
sequence_id – The id of the client service communication
-
void clear_buffer()
Clear the currently buffered packet.
When the packet is read by the entity, this function must be called to clear the buffer and allow RxStream to add the next one in the queue.
-
template<typename T>
RxStream &deserialize_integer(T &n) Decode a generic integer.
- Parameters:
n – Field to decode
Public Static Functions
-
static void interpret_packets()
Interpret raw packets and splits them into different communication types.
Raw packets from TcpDaemon are read and interpreted in order to put them in a map where the key allows to distinguish the topic name or the service name, and eventually the sequence identifier.
-
RxStream(uint8_t stream_type, std::string stream_name, uint8_t stream_identifier)