CatapultServer  v0.5.0.1 (Elephant)
catapult::ionet::PacketExtractor Class Reference

Helper for extracting a packet from a working buffer. More...

Public Member Functions

 PacketExtractor (ByteBuffer &data, size_t maxPacketDataSize)
 
PacketExtractResult tryExtractNextPacket (const Packet *&pExtractedPacket)
 Tries to extract the next packet into (pExtractedPacket). More...
 
void consume ()
 Marks all extracted packets as consumed and deletes their backing memory. More...
 

Private Attributes

ByteBufferm_data
 
size_t m_maxPacketDataSize
 
size_t m_consumedBytes
 

Detailed Description

Helper for extracting a packet from a working buffer.

Constructor & Destructor Documentation

◆ PacketExtractor()

catapult::ionet::PacketExtractor::PacketExtractor ( ByteBuffer data,
size_t  maxPacketDataSize 
)

Creates a packet extractor for extracting a packet from data that allows a maximum packet data size of maxPacketDataSize.

Member Function Documentation

◆ consume()

void catapult::ionet::PacketExtractor::consume ( )

Marks all extracted packets as consumed and deletes their backing memory.

◆ tryExtractNextPacket()

PacketExtractResult catapult::ionet::PacketExtractor::tryExtractNextPacket ( const Packet *&  pExtractedPacket)

Tries to extract the next packet into (pExtractedPacket).

Here is the call graph for this function:

Member Data Documentation

◆ m_consumedBytes

size_t catapult::ionet::PacketExtractor::m_consumedBytes
private

◆ m_data

ByteBuffer& catapult::ionet::PacketExtractor::m_data
private

◆ m_maxPacketDataSize

size_t catapult::ionet::PacketExtractor::m_maxPacketDataSize
private

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