|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Generic helpers for reading and writing integer and byte data in big- and little-endian wire formats. More...
#include <algorithm>#include <array>#include <cstddef>#include <cstdint>#include <ranges>#include <span>#include <string>#include <type_traits>#include <vector>
Include dependency graph for wire.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | profinet::wire::Reader |
| Lightweight cursor for parsing a big-endian byte buffer without copies. More... | |
Namespaces | |
| namespace | profinet |
| namespace | profinet::wire |
Functions | |
| template<typename T > requires std::is_integral_v<T> && std::is_unsigned_v<T> | |
| void | profinet::wire::PutBigEndian (std::vector< std::uint8_t > &out, T value) |
| Append an unsigned integral value to a buffer in big-endian order. | |
| template<typename T > requires std::is_integral_v<T> && std::is_unsigned_v<T> | |
| void | profinet::wire::PutLittleEndian (std::vector< std::uint8_t > &out, T value) |
| Append an unsigned integral value to a buffer in little-endian order. | |
| template<typename T > requires std::is_integral_v<T> && std::is_unsigned_v<T> | |
| void | profinet::wire::PutLittleEndian (std::uint8_t *out, T value) |
| Writes an unsigned integer in little-endian byte order. | |
| void | profinet::wire::PutU8 (std::vector< std::uint8_t > &out, std::uint8_t value) |
| Append a single byte to a buffer. | |
| void | profinet::wire::PutU16 (std::vector< std::uint8_t > &out, std::uint16_t value) |
| Append a 16-bit value to a buffer in big-endian order. | |
| void | profinet::wire::PutU32 (std::vector< std::uint8_t > &out, std::uint32_t value) |
| Append a 32-bit value to a buffer in big-endian order. | |
| void | profinet::wire::PutBytes (std::vector< std::uint8_t > &out, const std::uint8_t *data, std::size_t len) |
| Append a raw byte range to a buffer. | |
| template<std::size_t N> | |
| void | profinet::wire::PutFixed (std::vector< std::uint8_t > &out, const std::array< std::uint8_t, N > &data) |
| Append a fixed-size byte array to a buffer. | |
| void | profinet::wire::PutFixed (std::vector< std::uint8_t > &out, const std::vector< std::uint8_t > &data) |
| Append a byte vector to a buffer. | |
| void | profinet::wire::PutFixed (std::vector< std::uint8_t > &out, const std::string &data) |
| Append a string to a buffer. | |
| template<typename T > requires std::is_integral_v<T> && std::is_unsigned_v<T> | |
| constexpr T | profinet::wire::ReadBigEndian (const std::uint8_t *data) |
| Decode an unsigned integral value from big-endian bytes. | |
| template<typename T > requires std::is_integral_v<T> && std::is_unsigned_v<T> | |
| constexpr T | profinet::wire::ReadLittleEndian (const std::uint8_t *data) |
| Decode an unsigned integral value from little-endian bytes. | |
Variables | |
| constexpr unsigned | profinet::wire::kBitsPerByte = 8U |
Generic helpers for reading and writing integer and byte data in big- and little-endian wire formats.
Definition in file wire.h.