jaulib v1.3.0
Jau Support Library (C++, Java, ..)
|
Transient read only and endian aware octet data, i.e. More...
#include <octets.hpp>
Public Member Functions | |
TROOctets () noexcept | |
Default constructor with nullptr memory, zero size and lb_endian::native byte order. More... | |
TROOctets (const TROOctets &o) noexcept=default | |
TROOctets (const uint8_t *source, const nsize_t len, const lb_endian_t byte_order_val) noexcept | |
Transient passthrough read-only memory, w/o ownership . More... | |
TROOctets (TROOctets &&o) noexcept=default | |
virtual | ~TROOctets () noexcept=default |
constexpr lb_endian_t | byte_order () const noexcept |
Returns byte order of this octet store. More... | |
void | check_range (const nsize_t i, const nsize_t count, const char *file, int line) const |
EUI48 | get_eui48 (const nsize_t i) const |
EUI48 | get_eui48_nc (const nsize_t i) const noexcept |
int8_t | get_int8 (const nsize_t i) const |
constexpr int8_t | get_int8_nc (const nsize_t i) const noexcept |
constexpr uint8_t const * | get_ptr () const noexcept |
uint8_t const * | get_ptr (const nsize_t i) const |
constexpr uint8_t const * | get_ptr_nc (const nsize_t i) const noexcept |
std::string | get_string (const nsize_t i) const |
Assumes a null terminated string. More... | |
std::string | get_string (const nsize_t i, const nsize_t length) const |
Assumes a string with defined length, not necessarily null terminated. More... | |
std::string | get_string_nc (const nsize_t i) const noexcept |
Assumes a null terminated string. More... | |
uint128dp_t | get_uint128 (const nsize_t i) const |
constexpr uint128dp_t | get_uint128_nc (const nsize_t i) const noexcept |
uint16_t | get_uint16 (const nsize_t i) const |
constexpr uint16_t | get_uint16_nc (const nsize_t i) const noexcept |
uint192dp_t | get_uint192 (const nsize_t i) const |
constexpr uint192dp_t | get_uint192_nc (const nsize_t i) const noexcept |
uint256dp_t | get_uint256 (const nsize_t i) const |
constexpr uint256dp_t | get_uint256_nc (const nsize_t i) const noexcept |
uint32_t | get_uint32 (const nsize_t i) const |
constexpr uint32_t | get_uint32_nc (const nsize_t i) const noexcept |
uint64_t | get_uint64 (const nsize_t i) const |
constexpr uint64_t | get_uint64_nc (const nsize_t i) const noexcept |
uint8_t | get_uint8 (const nsize_t i) const |
constexpr uint8_t | get_uint8_nc (const nsize_t i) const noexcept |
std::unique_ptr< const uuid_t > | get_uuid (const nsize_t i, const uuid_t::TypeSize tsize) const |
uuid128_t | get_uuid128 (const nsize_t i) const |
uuid128_t | get_uuid128_nc (const nsize_t i) const noexcept |
uuid16_t | get_uuid16 (const nsize_t i) const |
uuid16_t | get_uuid16_nc (const nsize_t i) const noexcept |
constexpr bool | is_range_valid (const nsize_t i, const nsize_t count) const noexcept |
bool | operator!= (const TROOctets &rhs) const noexcept |
TROOctets & | operator= (const TROOctets &o) noexcept=default |
TROOctets & | operator= (TROOctets &&o) noexcept=default |
bool | operator== (const TROOctets &rhs) const noexcept |
constexpr nsize_t | size () const noexcept |
Returns the used memory size for read and write operations, may be zero. More... | |
std::string | toString () const noexcept |
Protected Member Functions | |
constexpr uint8_t * | data () noexcept |
void | setData (uint8_t *data_, nsize_t size_, const lb_endian_t byte_order) noexcept |
Internally sets the _size and _data fields after validation. More... | |
constexpr void | setSize (nsize_t s) noexcept |
Static Protected Member Functions | |
static void | checkPtr (uint8_t *data_, nsize_t size_) noexcept |
Validates the given data_ and size_. More... | |
Transient read only and endian aware octet data, i.e.
non persistent passthrough, owned by caller.
Endian byte order is passed at construction.
Constructor and assignment operations are noexcept
. In case invalid arguments are passed, abort() is being called. This is a design choice based on reusing already existing underlying resources.
Definition at line 66 of file octets.hpp.
|
inlinenoexcept |
Transient passthrough read-only memory, w/o ownership .
Aborts if source is nullptr and len > 0.
source | a non nullptr memory, otherwise throws exception. Actual capacity known by owner. |
len | readable size of the memory, may be zero |
byte_order | lb_endian::little or lb_endian::big byte order, one may pass lb_endian::native. |
Definition at line 123 of file octets.hpp.
|
inlinenoexcept |
Default constructor with nullptr memory, zero size and lb_endian::native byte order.
Conveniently exists to allow instantiation of variables intended for later assignment.
Definition at line 136 of file octets.hpp.
|
defaultnoexcept |
|
defaultnoexcept |
|
virtualdefaultnoexcept |
|
inlinestaticprotectednoexcept |
Validates the given data_ and size_.
Aborts if data_ is nullptr and size_ > 0.
data_ | a memory pointer |
size_ | claimed memory size |
Definition at line 85 of file octets.hpp.
|
inlineconstexprprotectednoexcept |
|
inlineprotectednoexcept |
Internally sets the _size and _data fields after validation.
Aborts if data_ is nullptr and size_ > 0.
data_ | a memory pointer |
size_ | used memory size |
byte_order | lb_endian::little or lb_endian::big byte order, one may pass lb_endian::native. |
Definition at line 103 of file octets.hpp.
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
Definition at line 154 of file octets.hpp.
|
inlineconstexprnoexcept |
Returns byte order of this octet store.
Definition at line 159 of file octets.hpp.
|
inlineconstexprnoexcept |
Returns the used memory size for read and write operations, may be zero.
Definition at line 162 of file octets.hpp.
|
inline |
|
inlineconstexprnoexcept |
|
inline |
Definition at line 172 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 176 of file octets.hpp.
|
inline |
|
inlineconstexprnoexcept |
|
inline |
Definition at line 188 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 192 of file octets.hpp.
Definition at line 196 of file octets.hpp.
Definition at line 200 of file octets.hpp.
|
inline |
Definition at line 204 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 208 of file octets.hpp.
|
inline |
Definition at line 212 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 216 of file octets.hpp.
|
inline |
Definition at line 220 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 224 of file octets.hpp.
|
inline |
Definition at line 228 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 232 of file octets.hpp.
|
inline |
Assumes a null terminated string.
Definition at line 237 of file octets.hpp.
|
inlinenoexcept |
Assumes a null terminated string.
Definition at line 242 of file octets.hpp.
Assumes a string with defined length, not necessarily null terminated.
Definition at line 247 of file octets.hpp.
Definition at line 252 of file octets.hpp.
Definition at line 255 of file octets.hpp.
Definition at line 259 of file octets.hpp.
Definition at line 263 of file octets.hpp.
|
inline |
Definition at line 267 of file octets.hpp.
|
inlineconstexprnoexcept |
|
inline |
Definition at line 273 of file octets.hpp.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Definition at line 281 of file octets.hpp.
|
inlinenoexcept |
Definition at line 284 of file octets.hpp.
|
inlinenoexcept |
Definition at line 288 of file octets.hpp.