HosrDiretta
Loading...
Searching...
No Matches
DIRETTA::StreamReceive Class Reference
Inheritance diagram for DIRETTA::StreamReceive:
DIRETTA::Receive ACQUA::Buffer

Public Member Functions

bool empty () const
 Checks if there is no valid data by comparing the size to zero.
 
std::size_t size () const
 Returns the size of valid data, adjusted by the Offset member.
 
const std::uint8_t * get () const
 Returns a pointer to the first byte of valid data, adjusted by the Offset member.
 
std::uint8_t * get ()
 Returns a pointer to the first byte of valid data, adjusted by the Offset member.
 
const char * get_char () const
 Returns the result of get() reinterpreted as a pointer to char.
 
char * get_char ()
 Returns the result of get() reinterpreted as a pointer to char.
 
std::uint64_t * get_64 ()
 Returns a pointer to a 64-bit unsigned integer by reinterpret_casting the pointer returned by get().
 
const std::uint64_t * get_64 () const
 Returns a pointer to const std::uint64_t by reinterpreting the pointer returned by get(). This member function is const and does not modify the object.
 
std::uint32_t * get_32 ()
 Returns a pointer to a 32-bit unsigned integer by reinterpreting the pointer returned by get().
 
const std::uint32_t * get_32 () const
 Returns the object's underlying data reinterpreted as a pointer to const std::uint32_t.
 
std::uint16_t * get_16 ()
 Returns a pointer to a 16-bit unsigned integer by reinterpret_cast-ing the pointer returned by get(). No runtime checks are performed.
 
const std::uint16_t * get_16 () const
 Returns a pointer to the underlying data reinterpreted as a const std::uint16_t pointer.
 
std::uint8_t * get_8 ()
 Returns the pointer from get() reinterpreted as a pointer to std::uint8_t.
 
const std::uint8_t * get_8 () const
 Returns a pointer to the underlying data reinterpreted as a pointer to const std::uint8_t.
 
 operator ACQUA::BufferCS ()
 Implicit conversion operator that creates a BufferCS from the object's data pointer and size.
 
void reset ()
 
void resize (std::size_t si)
 
void resize (std::size_t si, std::size_t off)
 
bool resize_noremap (std::size_t si)
 
bool resize_noremap (std::size_t si, std::size_t off)
 
void move (StreamReceive &in)
 
- Public Member Functions inherited from DIRETTA::Receive
 operator bool () const
 
MessageID getMessage () const
 
StatusID getStatus () const
 
std::uint16_t getOption0 () const
 
std::uint16_t getOption1 () const
 
std::uint16_t getOption2 () const
 
std::uint16_t getOption3 () const
 
std::uint64_t getOption () const
 
const std::uint8_t * get_data () const
 
std::uint16_t size_data () const
 
ACQUA::BufferCS_const get_data_CS () const
 
void get_str (std::string &) const
 
void get_str (std::list< std::string > &) const
 
void get_add_str (ACQUA::IPAddress &, std::string &) const
 
const std::size_t ms_size () const
 
const std::size_t ms2_size (size_t off) const
 
const std::size_t ms3_size (size_t off) const
 
const std::uint8_t ms_flg () const
 
const std::uint16_t ms_flg2 () const
 
const std::uint8_t ms_flg3 () const
 
const std::uint8_t ms_sta3 () const
 
const std::uint64_t ms_ext3 () const
 
bool ms_valid () const
 
- Public Member Functions inherited from ACQUA::Buffer
 Buffer (Buffer &&b) noexcept
 Move constructor.
 
 Buffer (const Buffer &)=delete
 
Bufferoperator= (const Buffer &b)=delete
 
 Buffer () noexcept
 Default constructor that initializes the underlying byte vector to empty and sets NoRemapSize to 0.
 
 Buffer (std::uint8_t *s, std::uint8_t *e) noexcept
 Constructs a Buffer by copying bytes from the range [s, e) into the underlying std::vector and initializes NoRemapSize to 0.
 
 Buffer (size_t sz) noexcept
 Constructs a Buffer by allocating a byte vector of the specified size and initializing NoRemapSize to 0.
 
std::uint8_t * get ()
 Returns a pointer to the first byte by taking the address of front().
 
const std::uint8_t * get () const
 Returns a pointer to the first byte (the address of front()).
 
char * get_char ()
 Returns the result of get() reinterpreted as a pointer to char.
 
const char * get_char () const
 Returns the result of get() reinterpreted as a pointer to const char.
 
std::uint64_t * get_64 ()
 Returns a pointer to a 64-bit unsigned integer by reinterpret_casting the pointer returned by get().
 
const std::uint64_t * get_64 () const
 Returns a pointer to const std::uint64_t by reinterpreting the pointer returned by get(). This member function is const and does not modify the object.
 
std::uint32_t * get_32 ()
 Returns a pointer to a 32-bit unsigned integer by reinterpreting the pointer returned by get().
 
const std::uint32_t * get_32 () const
 Returns the object's underlying data reinterpreted as a pointer to const std::uint32_t.
 
std::uint16_t * get_16 ()
 Returns a pointer to a 16-bit unsigned integer by reinterpret_cast-ing the pointer returned by get(). No runtime checks are performed.
 
const std::uint16_t * get_16 () const
 Returns a pointer to the underlying data reinterpreted as a const std::uint16_t pointer.
 
std::uint8_t * get_8 ()
 Returns the pointer from get() reinterpreted as a pointer to std::uint8_t.
 
const std::uint8_t * get_8 () const
 Returns a pointer to the underlying data reinterpreted as a pointer to const std::uint8_t.
 
 operator BufferCS ()
 Implicit conversion operator that creates a BufferCS from the object's data pointer and size.
 
 operator BufferCS_const () const
 Implicit conversion operator that produces a const BufferCS view of the object's data.
 
bool get_string_list (std::list< std::string > &, bool tab=false) const
 Extracts lines of text from the buffer and populates a list of strings.
 
void fill (std::uint8_t)
 Fills all memory with the specified value.
 
void fill (std::uint8_t, std::size_t, std::size_t=0)
 Fills all memory with the specified value.
 
Bufferoperator= (BufferCS_const)
 assignment
 
std::string dump () const
 Returns a textual dump of the object's buffer by converting to BufferCS_const and invoking its dump() method.
 
std::string dump (std::size_t s) const
 Returns a textual dump of the object's buffer by converting to BufferCS_const and invoking its dump() method. Size specification.
 
std::string get_string () const
 Returns a std::string containing the buffer's contents.
 
Bufferoperator+= (BufferCS_const buf)
 Appends the contents of the given buffer to this buffer.
 
void resize (std::size_t si)
 Change the actual memory size.
 
bool resize ()
 Adjust the actual memory size to match the length.
 
void resize (std::size_t si, std::uint8_t fl)
 Resizes the underlying byte container to the specified size, fills its contents with the given byte value.
 
bool resize_noremap (std::size_t si)
 Change the length without altering the actual memory size. if the size is zero, free the memory.
 
bool resize_noremap (std::size_t si, std::uint8_t fl)
 Change the length without altering the actual memory size. if the size is zero, free the memory.
 
std::size_t size () const
 Returns the number of elements. If NoRemapSize is non-zero, that value is returned; otherwise the function returns the underlying std::vector<std::uint8_t>::size().
 
void clear ()
 Clears the object's contents or resets its state to a default/empty condition.
 
void swap (Buffer &in)
 Swaps the contents of the specified Buffer.
 
void move (Buffer &in)
 Movde the contents of the specified Buffer.
 
std::vector< std::uint8_t >::iterator end ()
 Returns a non-const iterator to one past the last element of the std::vector<std::uint8_t>.
 
std::vector< std::uint8_t >::const_iterator end () const
 Returns a const iterator to the element following the last byte in the container.
 
std::vector< std::uint8_t >::iterator insert (std::vector< std::uint8_t >::const_iterator i, std::vector< std::uint8_t >::const_iterator s, std::vector< std::uint8_t >::const_iterator e)
 Inserts a range of bytes into the vector before the specified position.
 
std::vector< std::uint8_t >::iterator insert (std::vector< std::uint8_t >::const_iterator i, const std::uint8_t *s, const std::uint8_t *e)
 Inserts the bytes in the half-open range [s, e) into a std::vector<std::uint8_t> before the position i.
 
std::vector< std::uint8_t >::iterator erase (std::vector< std::uint8_t >::iterator s, std::vector< std::uint8_t >::iterator e)
 Erases the elements in the half-open range [s, e) from a std::vector<std::uint8_t> and returns an iterator to the element that followed the last removed element.
 

Protected Attributes

size_t Offset
 

Friends

class FifoStreamReceive
 

Member Function Documentation

◆ get_16() [1/2]

std::uint16_t * DIRETTA::StreamReceive::get_16 ( )
inline

Returns a pointer to a 16-bit unsigned integer by reinterpret_cast-ing the pointer returned by get(). No runtime checks are performed.

Returns
A std::uint16_t* that points to the same address as get(), reinterpreted as a pointer to std::uint16_t. The pointer may be null or invalid if the original pointer is null or not correctly aligned/compatible.

◆ get_16() [2/2]

const std::uint16_t * DIRETTA::StreamReceive::get_16 ( ) const
inline

Returns a pointer to the underlying data reinterpreted as a const std::uint16_t pointer.

Returns
A const std::uint16_t* that points to the same memory as get(), obtained via reinterpret_cast<const std::uint16_t*>(get()). May be nullptr if get() returns nullptr. No ownership is transferred.

◆ get_32() [1/2]

std::uint32_t * DIRETTA::StreamReceive::get_32 ( )
inline

Returns a pointer to a 32-bit unsigned integer by reinterpreting the pointer returned by get().

Returns
A std::uint32_t* obtained via reinterpret_cast<std::uint32_t*>(get()). The caller must ensure the underlying object returned by get() is suitable to be accessed as a std::uint32_t to avoid undefined behavior.

◆ get_32() [2/2]

const std::uint32_t * DIRETTA::StreamReceive::get_32 ( ) const
inline

Returns the object's underlying data reinterpreted as a pointer to const std::uint32_t.

Returns
A pointer to const std::uint32_t obtained by reinterpret_cast from get(). The pointer aliases the same memory as returned by get(); ownership and lifetime are unchanged and it may be nullptr if get() returns nullptr.

◆ get_64() [1/2]

std::uint64_t * DIRETTA::StreamReceive::get_64 ( )
inline

Returns a pointer to a 64-bit unsigned integer by reinterpret_casting the pointer returned by get().

Returns
A std::uint64_t* that points to the same memory as get(), reinterpreted as a pointer to std::uint64_t. The caller must ensure the underlying memory is valid and properly aligned for access as a std::uint64_t.

◆ get_64() [2/2]

const std::uint64_t * DIRETTA::StreamReceive::get_64 ( ) const
inline

Returns a pointer to const std::uint64_t by reinterpreting the pointer returned by get(). This member function is const and does not modify the object.

Returns
A pointer to const std::uint64_t obtained via reinterpret_cast from get(). May be null if get() returns null. The caller must ensure the underlying storage is properly aligned and actually contains uint64_t values; otherwise the behavior is undefined.

◆ get_8() [1/2]

std::uint8_t * DIRETTA::StreamReceive::get_8 ( )
inline

Returns the pointer from get() reinterpreted as a pointer to std::uint8_t.

Returns
A std::uint8_t* that points to the same address as the pointer returned by get(), obtained via reinterpret_cast. May be null if get() returns null; no ownership is transferred.

◆ get_8() [2/2]

const std::uint8_t * DIRETTA::StreamReceive::get_8 ( ) const
inline

Returns a pointer to the underlying data reinterpreted as a pointer to const std::uint8_t.

Returns
A const std::uint8_t* pointing to the same data as get(), obtained via reinterpret_cast. The pointer is valid as long as the underlying object or its data remain valid.

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