RMW desert 1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cbor::TxStream Class Reference

Public Member Functions

 TxStream (uint8_t stream_type, std::string stream_name, uint8_t stream_identifier)
 Create a transmission stream.
 
void start_transmission (uint64_t sequence_id)
 Tell the stream to create a new packet.
 
void start_transmission ()
 Tell the stream to create a new packet.
 
void end_transmission ()
 Tell the stream to send down the packet.
 
TxStreamoperator<< (const uint64_t n)
 Encode uint64.
 
TxStreamoperator<< (const uint32_t n)
 Encode uint32.
 
TxStreamoperator<< (const uint16_t n)
 Encode uint16.
 
TxStreamoperator<< (const uint8_t n)
 Encode uint8.
 
TxStreamoperator<< (const int64_t n)
 Encode int64.
 
TxStreamoperator<< (const int32_t n)
 Encode int32.
 
TxStreamoperator<< (const int16_t n)
 Encode int16.
 
TxStreamoperator<< (const int8_t n)
 Encode int8.
 
TxStreamoperator<< (const char n)
 Encode char.
 
TxStreamoperator<< (const float f)
 Encode float.
 
TxStreamoperator<< (const double d)
 Encode double.
 
TxStreamoperator<< (const std::string s)
 Encode string.
 
TxStreamoperator<< (const std::u16string s)
 Encode u16string.
 
TxStreamoperator<< (const bool b)
 Encode bool.
 
template<typename T >
TxStreamoperator<< (const std::vector< T > v)
 Encode vector.
 
TxStreamoperator<< (const std::vector< bool > v)
 Encode bool vector.
 
template<typename T >
TxStreamserialize_sequence (const T *items, size_t size)
 Serialize a sequence of uniform elements.
 

Constructor & Destructor Documentation

◆ TxStream()

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

Create a transmission stream.

Parameters
stream_typeType of the object using the current instance
stream_nameName of the topic or the service to which the communication belongs
stream_identifierIdentifier of the topic or the service read from configuration

Member Function Documentation

◆ end_transmission()

void cbor::TxStream::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.

◆ operator<<() [1/16]

TxStream & cbor::TxStream::operator<< ( const bool  b)

Encode bool.

Parameters
bField to encode

◆ operator<<() [2/16]

TxStream & cbor::TxStream::operator<< ( const char  n)

Encode char.

Parameters
nField to encode

◆ operator<<() [3/16]

TxStream & cbor::TxStream::operator<< ( const double  d)

Encode double.

Parameters
dField to encode

◆ operator<<() [4/16]

TxStream & cbor::TxStream::operator<< ( const float  f)

Encode float.

Parameters
fField to encode

◆ operator<<() [5/16]

TxStream & cbor::TxStream::operator<< ( const int16_t  n)

Encode int16.

Parameters
nField to encode

◆ operator<<() [6/16]

TxStream & cbor::TxStream::operator<< ( const int32_t  n)

Encode int32.

Parameters
nField to encode

◆ operator<<() [7/16]

TxStream & cbor::TxStream::operator<< ( const int64_t  n)

Encode int64.

Parameters
nField to encode

◆ operator<<() [8/16]

TxStream & cbor::TxStream::operator<< ( const int8_t  n)

Encode int8.

Parameters
nField to encode

◆ operator<<() [9/16]

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

Encode string.

Parameters
sField to encode

◆ operator<<() [10/16]

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

Encode u16string.

Parameters
sField to encode

◆ operator<<() [11/16]

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

Encode bool vector.

Parameters
vField to encode

◆ operator<<() [12/16]

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

Encode vector.

Parameters
vField to encode

◆ operator<<() [13/16]

TxStream & cbor::TxStream::operator<< ( const uint16_t  n)

Encode uint16.

Parameters
nField to encode

◆ operator<<() [14/16]

TxStream & cbor::TxStream::operator<< ( const uint32_t  n)

Encode uint32.

Parameters
nField to encode

◆ operator<<() [15/16]

TxStream & cbor::TxStream::operator<< ( const uint64_t  n)

Encode uint64.

Parameters
nField to encode

◆ operator<<() [16/16]

TxStream & cbor::TxStream::operator<< ( const uint8_t  n)

Encode uint8.

Parameters
nField to encode

◆ serialize_sequence()

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

Serialize a sequence of uniform elements.

Parameters
itemsPointer to the first element
sizeSize of the items array

◆ start_transmission() [1/2]

void cbor::TxStream::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.

◆ start_transmission() [2/2]

void cbor::TxStream::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_idThe id of the client service communication

The documentation for this class was generated from the following files: