Class TxStream

Class Documentation

class TxStream

Public Functions

TxStream(uint8_t stream_type, std::string stream_name, uint8_t stream_identifier)

Create a transmission 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

void start_transmission(uint64_t sequence_id)

Tell the stream to create a new packet.

Every time a transmission in started, a new empty packet must be generated and saved as a private member. Then type, service name and sequence id are put in front of the data.

Parameters:

sequence_id – The id of the client service communication

void start_transmission()

Tell the stream to create a new packet.

Every time a transmission in started, a new empty packet must be generated and saved as a private member. Then type and topic name are put in front of the data.

void end_transmission()

Tell the stream to send down the packet.

When the transmission is finished the packet is stored in the static member of TcpDaemon in order to be sent to DESERT.

TxStream &operator<<(const uint64_t n)

Encode uint64.

Parameters:

n – Field to encode

TxStream &operator<<(const uint32_t n)

Encode uint32.

Parameters:

n – Field to encode

TxStream &operator<<(const uint16_t n)

Encode uint16.

Parameters:

n – Field to encode

TxStream &operator<<(const uint8_t n)

Encode uint8.

Parameters:

n – Field to encode

TxStream &operator<<(const int64_t n)

Encode int64.

Parameters:

n – Field to encode

TxStream &operator<<(const int32_t n)

Encode int32.

Parameters:

n – Field to encode

TxStream &operator<<(const int16_t n)

Encode int16.

Parameters:

n – Field to encode

TxStream &operator<<(const int8_t n)

Encode int8.

Parameters:

n – Field to encode

TxStream &operator<<(const char n)

Encode char.

Parameters:

n – Field to encode

TxStream &operator<<(const float f)

Encode float.

Parameters:

f – Field to encode

TxStream &operator<<(const double d)

Encode double.

Parameters:

d – Field to encode

TxStream &operator<<(const std::string s)

Encode string.

Parameters:

s – Field to encode

TxStream &operator<<(const std::u16string s)

Encode u16string.

Parameters:

s – Field to encode

TxStream &operator<<(const bool b)

Encode bool.

Parameters:

b – Field to encode

template<typename T>
inline TxStream &operator<<(const std::vector<T> v)

Encode vector.

Parameters:

v – Field to encode

TxStream &operator<<(const std::vector<bool> v)

Encode bool vector.

Parameters:

v – Field to encode

template<typename T>
inline TxStream &serialize_sequence(const T *items, size_t size)

Serialize a sequence of uniform elements.

Parameters:
  • items – Pointer to the first element

  • size – Size of the items array