jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Public Member Functions | List of all members
jau::TOctets Class Reference

Transient endian aware octet data, i.e. More...

#include <octets.hpp>

Inheritance diagram for jau::TOctets:
Collaboration diagram for jau::TOctets:

Public Member Functions

 TOctets (const TOctets &o) noexcept=default
 
 TOctets (TOctets &&o) noexcept=default
 
 TOctets (uint8_t *source, const nsize_t len, const lb_endian_t byte_order) noexcept
 Transient passthrough r/w memory, w/o ownership . More...
 
 ~TOctets () noexcept override=default
 
void bzero () noexcept
 
void bzero (const nsize_t i, const nsize_t byte_count)
 
void bzero_nc (const nsize_t i, const nsize_t byte_count) noexcept
 
uint8_t * get_wptr () noexcept
 
uint8_t * get_wptr (const nsize_t i)
 
uint8_t * get_wptr_nc (const nsize_t i) noexcept
 
void memmove (const nsize_t i, const uint8_t *source, const nsize_t byte_count)
 
void memmove_nc (const nsize_t i, const uint8_t *source, const nsize_t byte_count) noexcept
 
void memset (const nsize_t i, const uint8_t c, const nsize_t byte_count)
 
void memset_nc (const nsize_t i, const uint8_t c, const nsize_t byte_count) noexcept
 
TOctetsoperator= (const TOctets &o) noexcept=default
 
TOctetsoperator= (TOctets &&o) noexcept=default
 
void put_bytes (const nsize_t i, const uint8_t *source, const nsize_t byte_count)
 
void put_bytes_nc (const nsize_t i, const uint8_t *source, const nsize_t byte_count) noexcept
 
void put_eui48 (const nsize_t i, const EUI48 &v)
 
void put_eui48_nc (const nsize_t i, const EUI48 &v) noexcept
 
void put_int8 (const nsize_t i, const int8_t v)
 
constexpr void put_int8_nc (const nsize_t i, const int8_t v) noexcept
 
void put_octets (const nsize_t i, const TROOctets &v)
 
void put_octets (const nsize_t i, const TROOctets &v, const nsize_t v_off, const nsize_t v_len) noexcept
 
void put_octets_nc (const nsize_t i, const TROOctets &v) noexcept
 
void put_octets_nc (const nsize_t i, const TROOctets &v, const nsize_t v_off, const nsize_t v_len) noexcept
 
void put_string (const nsize_t i, const std::string &v, const nsize_t max_len, const bool includeEOS)
 
void put_string_nc (const nsize_t i, const std::string &v, const nsize_t max_len, const bool includeEOS) noexcept
 
void put_uint128 (const nsize_t i, const uint128dp_t &v)
 
constexpr void put_uint128_nc (const nsize_t i, const uint128dp_t &v) noexcept
 
void put_uint16 (const nsize_t i, const uint16_t v)
 
constexpr void put_uint16_nc (const nsize_t i, const uint16_t v) noexcept
 
void put_uint192 (const nsize_t i, const uint192dp_t &v)
 
constexpr void put_uint192_nc (const nsize_t i, const uint192dp_t &v) noexcept
 
void put_uint256 (const nsize_t i, const uint256dp_t &v)
 
constexpr void put_uint256_nc (const nsize_t i, const uint256dp_t &v) noexcept
 
void put_uint32 (const nsize_t i, const uint32_t v)
 
constexpr void put_uint32_nc (const nsize_t i, const uint32_t v) noexcept
 
void put_uint64 (const nsize_t i, const uint64_t &v)
 
constexpr void put_uint64_nc (const nsize_t i, const uint64_t &v) noexcept
 
void put_uint8 (const nsize_t i, const uint8_t v)
 
constexpr void put_uint8_nc (const nsize_t i, const uint8_t v) noexcept
 
void put_uuid (const nsize_t i, const uuid_t &v)
 
void put_uuid_nc (const nsize_t i, const uuid_t &v) noexcept
 
std::string toString () const noexcept
 
- Public Member Functions inherited from jau::TROOctets
 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_tget_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
 
TROOctetsoperator= (const TROOctets &o) noexcept=default
 
TROOctetsoperator= (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
 

Additional Inherited Members

- Protected Member Functions inherited from jau::TROOctets
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 inherited from jau::TROOctets
static void checkPtr (uint8_t *data_, nsize_t size_) noexcept
 Validates the given data_ and size_. More...
 

Detailed Description

Transient 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 301 of file octets.hpp.

Constructor & Destructor Documentation

◆ TOctets() [1/3]

jau::TOctets::TOctets ( uint8_t *  source,
const nsize_t  len,
const lb_endian_t  byte_order 
)
inlinenoexcept

Transient passthrough r/w memory, w/o ownership .

Aborts if source is nullptr and len > 0.

Parameters
sourcetransient data source
lenlength of transient data source
byte_orderlb_endian::little or lb_endian::big byte order, one may pass lb_endian::native.

Definition at line 313 of file octets.hpp.

◆ TOctets() [2/3]

jau::TOctets::TOctets ( const TOctets o)
defaultnoexcept

◆ TOctets() [3/3]

jau::TOctets::TOctets ( TOctets &&  o)
defaultnoexcept

◆ ~TOctets()

jau::TOctets::~TOctets ( )
overridedefaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

TOctets & jau::TOctets::operator= ( const TOctets o)
defaultnoexcept

◆ operator=() [2/2]

TOctets & jau::TOctets::operator= ( TOctets &&  o)
defaultnoexcept

◆ put_int8()

void jau::TOctets::put_int8 ( const nsize_t  i,
const int8_t  v 
)
inline

Definition at line 323 of file octets.hpp.

◆ put_int8_nc()

constexpr void jau::TOctets::put_int8_nc ( const nsize_t  i,
const int8_t  v 
)
inlineconstexprnoexcept

Definition at line 327 of file octets.hpp.

◆ put_uint8()

void jau::TOctets::put_uint8 ( const nsize_t  i,
const uint8_t  v 
)
inline

Definition at line 331 of file octets.hpp.

◆ put_uint8_nc()

constexpr void jau::TOctets::put_uint8_nc ( const nsize_t  i,
const uint8_t  v 
)
inlineconstexprnoexcept

Definition at line 335 of file octets.hpp.

◆ put_uint16()

void jau::TOctets::put_uint16 ( const nsize_t  i,
const uint16_t  v 
)
inline

Definition at line 339 of file octets.hpp.

◆ put_uint16_nc()

constexpr void jau::TOctets::put_uint16_nc ( const nsize_t  i,
const uint16_t  v 
)
inlineconstexprnoexcept

Definition at line 343 of file octets.hpp.

◆ put_uint32()

void jau::TOctets::put_uint32 ( const nsize_t  i,
const uint32_t  v 
)
inline

Definition at line 347 of file octets.hpp.

◆ put_uint32_nc()

constexpr void jau::TOctets::put_uint32_nc ( const nsize_t  i,
const uint32_t  v 
)
inlineconstexprnoexcept

Definition at line 351 of file octets.hpp.

◆ put_eui48()

void jau::TOctets::put_eui48 ( const nsize_t  i,
const EUI48 v 
)
inline

Definition at line 355 of file octets.hpp.

◆ put_eui48_nc()

void jau::TOctets::put_eui48_nc ( const nsize_t  i,
const EUI48 v 
)
inlinenoexcept

Definition at line 359 of file octets.hpp.

◆ put_uint64()

void jau::TOctets::put_uint64 ( const nsize_t  i,
const uint64_t &  v 
)
inline

Definition at line 363 of file octets.hpp.

◆ put_uint64_nc()

constexpr void jau::TOctets::put_uint64_nc ( const nsize_t  i,
const uint64_t &  v 
)
inlineconstexprnoexcept

Definition at line 367 of file octets.hpp.

◆ put_uint128()

void jau::TOctets::put_uint128 ( const nsize_t  i,
const uint128dp_t v 
)
inline

Definition at line 371 of file octets.hpp.

◆ put_uint128_nc()

constexpr void jau::TOctets::put_uint128_nc ( const nsize_t  i,
const uint128dp_t v 
)
inlineconstexprnoexcept

Definition at line 375 of file octets.hpp.

◆ put_uint192()

void jau::TOctets::put_uint192 ( const nsize_t  i,
const uint192dp_t v 
)
inline

Definition at line 379 of file octets.hpp.

◆ put_uint192_nc()

constexpr void jau::TOctets::put_uint192_nc ( const nsize_t  i,
const uint192dp_t v 
)
inlineconstexprnoexcept

Definition at line 383 of file octets.hpp.

◆ put_uint256()

void jau::TOctets::put_uint256 ( const nsize_t  i,
const uint256dp_t v 
)
inline

Definition at line 387 of file octets.hpp.

◆ put_uint256_nc()

constexpr void jau::TOctets::put_uint256_nc ( const nsize_t  i,
const uint256dp_t v 
)
inlineconstexprnoexcept

Definition at line 391 of file octets.hpp.

◆ put_octets() [1/2]

void jau::TOctets::put_octets ( const nsize_t  i,
const TROOctets v 
)
inline

Definition at line 395 of file octets.hpp.

◆ put_octets_nc() [1/2]

void jau::TOctets::put_octets_nc ( const nsize_t  i,
const TROOctets v 
)
inlinenoexcept

Definition at line 399 of file octets.hpp.

◆ put_octets() [2/2]

void jau::TOctets::put_octets ( const nsize_t  i,
const TROOctets v,
const nsize_t  v_off,
const nsize_t  v_len 
)
inlinenoexcept

Definition at line 402 of file octets.hpp.

◆ put_octets_nc() [2/2]

void jau::TOctets::put_octets_nc ( const nsize_t  i,
const TROOctets v,
const nsize_t  v_off,
const nsize_t  v_len 
)
inlinenoexcept

Definition at line 407 of file octets.hpp.

◆ put_bytes()

void jau::TOctets::put_bytes ( const nsize_t  i,
const uint8_t *  source,
const nsize_t  byte_count 
)
inline

Definition at line 412 of file octets.hpp.

◆ put_bytes_nc()

void jau::TOctets::put_bytes_nc ( const nsize_t  i,
const uint8_t *  source,
const nsize_t  byte_count 
)
inlinenoexcept

Definition at line 416 of file octets.hpp.

◆ memmove()

void jau::TOctets::memmove ( const nsize_t  i,
const uint8_t *  source,
const nsize_t  byte_count 
)
inline

Definition at line 420 of file octets.hpp.

◆ memmove_nc()

void jau::TOctets::memmove_nc ( const nsize_t  i,
const uint8_t *  source,
const nsize_t  byte_count 
)
inlinenoexcept

Definition at line 424 of file octets.hpp.

◆ memset()

void jau::TOctets::memset ( const nsize_t  i,
const uint8_t  c,
const nsize_t  byte_count 
)
inline

Definition at line 428 of file octets.hpp.

◆ memset_nc()

void jau::TOctets::memset_nc ( const nsize_t  i,
const uint8_t  c,
const nsize_t  byte_count 
)
inlinenoexcept

Definition at line 432 of file octets.hpp.

◆ bzero() [1/2]

void jau::TOctets::bzero ( const nsize_t  i,
const nsize_t  byte_count 
)
inline

Definition at line 435 of file octets.hpp.

◆ bzero_nc()

void jau::TOctets::bzero_nc ( const nsize_t  i,
const nsize_t  byte_count 
)
inlinenoexcept

Definition at line 439 of file octets.hpp.

◆ bzero() [2/2]

void jau::TOctets::bzero ( )
inlinenoexcept

Definition at line 442 of file octets.hpp.

Here is the caller graph for this function:

◆ put_string()

void jau::TOctets::put_string ( const nsize_t  i,
const std::string &  v,
const nsize_t  max_len,
const bool  includeEOS 
)
inline

Definition at line 448 of file octets.hpp.

◆ put_string_nc()

void jau::TOctets::put_string_nc ( const nsize_t  i,
const std::string &  v,
const nsize_t  max_len,
const bool  includeEOS 
)
inlinenoexcept

Definition at line 457 of file octets.hpp.

◆ put_uuid()

void jau::TOctets::put_uuid ( const nsize_t  i,
const uuid_t v 
)
inline

Definition at line 466 of file octets.hpp.

◆ put_uuid_nc()

void jau::TOctets::put_uuid_nc ( const nsize_t  i,
const uuid_t v 
)
inlinenoexcept

Definition at line 470 of file octets.hpp.

◆ get_wptr() [1/2]

uint8_t * jau::TOctets::get_wptr ( )
inlinenoexcept

Definition at line 474 of file octets.hpp.

◆ get_wptr() [2/2]

uint8_t * jau::TOctets::get_wptr ( const nsize_t  i)
inline

Definition at line 476 of file octets.hpp.

◆ get_wptr_nc()

uint8_t * jau::TOctets::get_wptr_nc ( const nsize_t  i)
inlinenoexcept

Definition at line 480 of file octets.hpp.

◆ toString()

std::string jau::TOctets::toString ( ) const
inlinenoexcept

Definition at line 484 of file octets.hpp.


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