herald  2.0.0
Public Member Functions | List of all members
herald::datatype::PayloadData Class Reference
Inheritance diagram for herald::datatype::PayloadData:
herald::datatype::DataRef< MemoryArenaT >

Public Member Functions

 PayloadData (const Data &from)
 
 PayloadData (const std::byte *data, std::size_t length)
 
 PayloadData (std::byte repeating, std::size_t count)
 
std::string shortName () const
 
std::string toString () const
 
- Public Member Functions inherited from herald::datatype::DataRef< MemoryArenaT >
 DataRef ()
 Creates a DataRef with no memory used.
 
 DataRef (DataRef &&other)
 Takes control of another DataRef's memory allocation.
 
 DataRef (const std::uint8_t *value, std::size_t length)
 Initialises a DataRef from a std::uint8_t array of length length
 
 DataRef (const std::byte *value, std::size_t length)
 Initialises a DataRef from a std::byte array of length length
 
 DataRef (const std::string &from)
 Initialises a DataRef from a string of chars.
 
 DataRef (const DataRef &from)
 Initialises a DataRef copying another data object (uses more data, to ensure only one object owns the entry)
 
 DataRef (std::byte repeating, std::size_t count)
 Initialises a DataRef with count number of repeating bytes.
 
 DataRef (std::size_t reserveLength)
 Initialises a DataRef with reserveLength bytes of undefined data.
 
DataRefoperator= (const DataRef &other)
 Copy assign operator. Copies the data to be sure only one object owns the entry.
 
 ~DataRef ()
 Default destructor.
 
std::string description () const
 Returns the hex encoded string represetation as the description.
 
DataRef subdata (std::size_t offset) const
 Returns a NEWLY allocated DataRef instance returning a subset of this instance.
 
DataRef subdata (std::size_t offset, std::size_t length) const
 Returns a NEWLY allocated DataRef instance returning a subset of this instance.
 
std::byte at (std::size_t index) const
 Returns the individual byte at index position, or a byte value of zero if index is out of bounds.
 
void assign (const DataRef &other)
 Assigns the data in-place, reserving the size required if the current size is too small. More...
 
void append (const DataRef &rawData, std::size_t offset, std::size_t length)
 Copies another DataRef into this instance, expanding if required.
 
void append (const std::string &rawData)
 Appends a set of characters to the end of this DataRef.
 
void append (const std::uint8_t *rawData, std::size_t offset, std::size_t length)
 Copies a uint8_t array onto the end of this instance, expanding if necessary.
 
void appendReversed (const DataRef &rawData, std::size_t offset, std::size_t length)
 Appends the specified DataRef to this one, but in its reverse order.
 
void append (const DataRef &rawData)
 Appends the specified DataRef to this one.
 
void append (std::byte rawData)
 Appends a single byte.
 
void append (uint8_t rawData)
 appends a single uint8_t
 
void append (uint16_t rawData)
 Appends a single uint16_t.
 
void append (uint32_t rawData)
 Appends a single uint32_t.
 
void append (uint64_t rawData)
 Appends a single uint64_t.
 
bool uint8 (std::size_t fromIndex, uint8_t &into) const noexcept
 Returns whether reading a single uint8_t to into at fromIndex was successful.
 
bool uint16 (std::size_t fromIndex, uint16_t &into) const noexcept
 Returns whether reading a single uint16_t to into at fromIndex was successful.
 
bool uint32 (std::size_t fromIndex, uint32_t &into) const noexcept
 Returns whether reading a single uint32_t to into at fromIndex was successful.
 
bool uint64 (std::size_t fromIndex, uint64_t &into) const noexcept
 Returns whether reading a single uint64_t to into at fromIndex was successful.
 
bool operator== (const DataRef &other) const noexcept
 Equality operator for another DataRef instance (same memory arena)
 
bool operator!= (const DataRef &other) const noexcept
 Inequality operator for another DataRef instance (same memory arena)
 
bool operator< (const DataRef &other) const noexcept
 Less than operator for another DataRef instance (same memory arena)
 
bool operator> (const DataRef &other) const noexcept
 Greater than operator for another DataRef instance (same memory arena)
 
DataRef reversed () const
 Returns a new DataRef instance with the same data as this one, but in the reverse order.
 
DataRef reverseEndianness () const
 Returns the same order of bytes, but with the bits in each byte reversed.
 
std::string hexEncodedString () const noexcept
 Returns a hex encoded string of this binary data.
 
std::size_t hashCode () const noexcept
 Returns the hash code of this instance.
 
std::size_t size () const noexcept
 Returns the size in allocated bytes of this instance.
 
void clear () noexcept
 Clears (deallocates) the bytes referred to by this instance.
 

Additional Inherited Members

- Static Public Member Functions inherited from herald::datatype::DataRef< MemoryArenaT >
static DataRef fromHexEncodedString (const std::string &hex)
 Creates a new DataRef object from a hexadecimal encoded string.
 
static MemoryArenaT & getArena ()
 
- Protected Attributes inherited from herald::datatype::DataRef< MemoryArenaT >
MemoryArenaEntry entry
 
- Static Protected Attributes inherited from herald::datatype::DataRef< MemoryArenaT >
static const char hexChars []
 
static MemoryArenaT arena = MemoryArenaT()
 Instantiates the MemoryArena instance used by all DataRefs that share it.
 

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