Class CAccessorRxPacket#
Defined in File mem_buffer_accessor.h
Class Documentation#
-
class CAccessorRxPacket#
Rx access can be done randomly. To ensure the the data is released properly, the accessor packet is returned to manage this.
Public Functions
-
CAccessorRxPacket() = default#
Default constructor.
-
CAccessorRxPacket(CMemBufferAccessorRx &rAccessor, CMemBufferAccessorBase::SPacketHdr *pPacketHdr)#
Constructor.
- Parameters:
rAccessor – [in] Reference to the accessor managing the buffer.
pPacketHdr – [in] Pointer to the packet header.
-
CAccessorRxPacket(const CAccessorRxPacket &rpacket) = delete#
Copy constructor is deleted.
- Parameters:
rpacket – [in] Reference to the packet to copy from.
-
CAccessorRxPacket(CAccessorRxPacket &&rpacket) noexcept#
Move constructor.
- Parameters:
rpacket – [in] Reference to the packet to move from.
-
CAccessorRxPacket &operator=(const CAccessorRxPacket &rpacket) = delete#
Copy operator is deleted.
- Parameters:
rpacket – [in] Reference to the packet to copy from.
- Returns:
Reference to this packet class.
-
CAccessorRxPacket &operator=(CAccessorRxPacket &&rpacket) noexcept#
Copy operator is deleted.
- Parameters:
rpacket – [in] Reference to the packet to copy from.
- Returns:
Reference to this packet class.
-
operator bool() const#
Cast operator used to check validity.
-
bool IsValid() const#
Does the packet contain valid data (data pointer is available and the size is not zero).
- Returns:
The validity of the packet.
-
void Reset()#
Reset the packet (not accepting the content). Packet will be available again for next request.
-
uint32_t GetSize() const#
Get the size of the packet data.
- Returns:
The packet size.
-
const uint8_t *GetData() const#
Get the packet pointer.
- Returns:
Pointer to the buffer holding the packet data or nullptr when the packet is cleared.
-
template<typename TData>
inline const TData *GetData(uint32_t uiOffset = 0) const# Templated version of GetData.
- Template Parameters:
TData – The type to cast the data pointer to.
- Parameters:
uiOffset – [in] The offset to use in bytes (default no offset).
- Returns:
Pointer to the data or NULL when the data doesn’t fit in the buffer.
-
void Accept()#
Accept the packet; packet will be released for new packet data.
-
CAccessorRxPacket() = default#