jaulib v1.3.6
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. | |
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 . | |
TROOctets (TROOctets &&o) noexcept=default | |
virtual | ~TROOctets () noexcept=default |
constexpr lb_endian_t | byte_order () const noexcept |
Returns byte order of this octet store. | |
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. | |
std::string | get_string (const nsize_t i, const nsize_t length) const |
Assumes a string with defined length, not necessarily null terminated. | |
std::string | get_string_nc (const nsize_t i) const noexcept |
Assumes a null terminated string. | |
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. | |
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. | |
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_. | |
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 63 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 120 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 133 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 82 of file octets.hpp.
|
inlineconstexprprotectednoexcept |
Definition at line 89 of file octets.hpp.
|
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 100 of file octets.hpp.
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
Definition at line 151 of file octets.hpp.
|
inlineconstexprnoexcept |
Returns byte order of this octet store.
Definition at line 156 of file octets.hpp.
|
inlineconstexprnoexcept |
Returns the used memory size for read and write operations, may be zero.
Definition at line 159 of file octets.hpp.
|
inline |
Definition at line 161 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 165 of file octets.hpp.
|
inline |
Definition at line 169 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 173 of file octets.hpp.
|
inline |
|
inlineconstexprnoexcept |
|
inline |
Definition at line 185 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 189 of file octets.hpp.
Definition at line 193 of file octets.hpp.
Definition at line 197 of file octets.hpp.
|
inline |
Definition at line 201 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 205 of file octets.hpp.
|
inline |
Definition at line 209 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 213 of file octets.hpp.
|
inline |
Definition at line 217 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 221 of file octets.hpp.
|
inline |
Definition at line 225 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 229 of file octets.hpp.
|
inline |
Assumes a null terminated string.
Definition at line 234 of file octets.hpp.
|
inlinenoexcept |
Assumes a null terminated string.
Definition at line 239 of file octets.hpp.
Assumes a string with defined length, not necessarily null terminated.
Definition at line 244 of file octets.hpp.
Definition at line 249 of file octets.hpp.
Definition at line 252 of file octets.hpp.
Definition at line 256 of file octets.hpp.
Definition at line 260 of file octets.hpp.
|
inline |
Definition at line 264 of file octets.hpp.
|
inlineconstexprnoexcept |
|
inline |
Definition at line 270 of file octets.hpp.
|
inlineconstexprnoexcept |
Definition at line 274 of file octets.hpp.
|
inlinenoexcept |
Definition at line 278 of file octets.hpp.
|
inlinenoexcept |
Definition at line 281 of file octets.hpp.
|
inlinenoexcept |
Definition at line 285 of file octets.hpp.