Network stream message container. (TCP). More...
#include <stream-message.hpp>
Public Member Functions | |
| StreamMessage () noexcept | |
| Creates a new empty stream message. | |
| StreamMessage (::StreamMessage streamMessage) noexcept | |
| Creates a new stream message. (TCP). | |
| const uint8_t * | getEnd () const noexcept |
| Returns stream message end pointer. | |
| bool | isComplete () const noexcept |
| Returns true if stream message is not empty and complete, otherwise false. | |
| size_t | getLeft () const noexcept |
| Returns stream message byte count left to read or write. | |
| bool | read (const void *&data, size_t count) noexcept |
| Reads data from the stream message and advances offset. | |
| bool | read (uint8_t &value) noexcept |
| Reads 8-bit unsigned integer value from the stream message and advances offset. | |
| bool | read (uint16_t &value) noexcept |
| Reads 16-bit unsigned integer value from the stream message and advances offset. | |
| bool | read (uint32_t &value) noexcept |
| Reads 32-bit unsigned integer value from the stream message and advances offset. | |
| bool | read (uint64_t &value) noexcept |
| Reads 64-bit unsigned integer value from the stream message and advances offset. | |
| bool | read (int8_t &value) noexcept |
| Reads 8-bit signed integer value from the stream message and advances offset. | |
| bool | read (int16_t &value) noexcept |
| Reads 16-bit signed integer value from the stream message and advances offset. | |
| bool | read (int32_t &value) noexcept |
| Reads 32-bit signed integer value from the stream message and advances offset. | |
| bool | read (int64_t &value) noexcept |
| Reads 64-bit signed integer value from the stream message and advances offset. | |
| bool | read (float &value) noexcept |
| Reads 32-bit floating point value from the stream message and advances offset. | |
| bool | read (double &value) noexcept |
| Reads 64-bit floating point value from the stream message and advances offset. | |
| bool | read (std::string_view &value, uint8_t lengthSize) noexcept |
| Reads string from the stream message and advances offset. | |
| bool | read (std::string &value, uint8_t lengthSize) noexcept |
| Reads string from the stream message and advances offset. | |
| bool | read (bool &value) noexcept |
| Reads boolean value from the stream message and advances offset. | |
| bool | read (const void *&data, size_t &dataSize, uint8_t lengthSize) noexcept |
| Reads data from the stream message and advances offset. | |
| template<class T> | |
| bool | read (std::vector< T > &data, uint8_t lengthSize) noexcept |
| Reads vector data from the stream message and advances offset. | |
Data Fields | |
| uint8_t * | iter |
Static Public Attributes | |
| static constexpr uint8_t | maxLengthSize = STREAM_MESSAGE_MAX_LENGTH_SIZE |
| Maximum size of the stream message length in bytes. | |
| static constexpr uint16_t | maxDatagramSize = MAX_DATAGRAM_MESSAGE_SIZE |
| Safe maximum UDP datagram size in bytes. (Includes IP and VPN overhead). | |
Protected Attributes | |
| uint8_t * | end |
Network stream message container. (TCP).
See the stream-message.h
|
inlinenoexcept |
Creates a new stream message. (TCP).
| streamMessage | target stream message data |
|
inlinenoexcept |
Returns true if stream message is not empty and complete, otherwise false.
See the isStreamMessageComplete().
|
inlinenoexcept |
Returns stream message byte count left to read or write.
See the getStreamMessageLeft().
|
inlinenoexcept |
Reads data from the stream message and advances offset.
See the readStreamMessage().
| [out] | data | reference to the message data |
| count | message byte count to read |
|
inlinenoexcept |
Reads 8-bit unsigned integer value from the stream message and advances offset.
See the readStreamMessageUint8().
| [out] | value | reference to the unsigned integer value |
|
inlinenoexcept |
Reads 16-bit unsigned integer value from the stream message and advances offset.
See the readStreamMessageUint16().
| [out] | value | reference to the unsigned integer value |
|
inlinenoexcept |
Reads 32-bit unsigned integer value from the stream message and advances offset.
See the readStreamMessageUint32().
| [out] | value | reference to the unsigned integer value |
|
inlinenoexcept |
Reads 64-bit unsigned integer value from the stream message and advances offset.
See the readStreamMessageUint64().
| [out] | value | reference to the unsigned integer value |
|
inlinenoexcept |
Reads 8-bit signed integer value from the stream message and advances offset.
See the readStreamMessageInt8().
| [out] | value | reference to the signed integer value |
|
inlinenoexcept |
Reads 16-bit signed integer value from the stream message and advances offset.
See the readStreamMessageInt16().
| [out] | value | reference to the signed integer value |
|
inlinenoexcept |
Reads 32-bit signed integer value from the stream message and advances offset.
See the readStreamMessageInt32().
| [out] | value | reference to the signed integer value |
|
inlinenoexcept |
Reads 64-bit signed integer value from the stream message and advances offset.
See the readStreamMessageInt64().
| [out] | value | reference to the signed integer value |
|
inlinenoexcept |
Reads 32-bit floating point value from the stream message and advances offset.
See the readStreamMessageFloat32().
| [out] | value | reference to the floating point value |
|
inlinenoexcept |
Reads 64-bit floating point value from the stream message and advances offset.
See the readStreamMessageFloat64().
| [out] | value | reference to the floating point value |
|
inlinenoexcept |
Reads string from the stream message and advances offset.
See the readStreamMessageData().
| [out] | value | reference to the message string |
| lengthSize | length of the string size in bytes |
|
inlinenoexcept |
Reads string from the stream message and advances offset.
See the readStreamMessageData().
| [out] | value | reference to the message string |
| lengthSize | length of the string size in bytes |
|
inlinenoexcept |
Reads boolean value from the stream message and advances offset.
See the readStreamMessageBool().
| [out] | value | reference to the boolean value |
Reads data from the stream message and advances offset.
See the readStreamMessageData().
| [out] | data | reference to the message data |
| [out] | dataSize | reference to the data size in bytes |
| lengthSize | length of the data size in bytes |
|
inlinenoexcept |
Reads vector data from the stream message and advances offset.
See the readStreamMessageData().
| T | type of the vector data |
| [out] | data | reference to the message data vector |
| lengthSize | length of the data size in bytes |