|
Grok 20.3.2
|
Manages packet buffers and associated packet parsers. More...
#include <PacketCache.h>
Public Member Functions | |
| PacketCache () | |
| Constructs a PacketCache. | |
| ~PacketCache () | |
| Destroys a PacketCache. | |
| void | next (size_t offset) |
| Moves to next chunk / packet buffer and associated PacketParser if present. | |
| void | rewind (void) override |
| Resets state to beginning of packet list, and beginning of parser list. | |
| PacketParser * | gen (ITileProcessor *tileProcessor, uint16_t packetSequenceNumber, uint16_t compno, uint8_t resno, uint64_t precinctIndex, uint16_t layno, uint32_t cachedLength) |
| Generates a PacketParser if it doesn't exist. | |
| Public Member Functions inherited from grk::SparseBuffer | |
| SparseBuffer () | |
| Constructs a SparseBuffer. | |
| virtual | ~SparseBuffer () |
| Destroys a SparseBuffer. | |
| size_t | skip (size_t numBytes) |
| Skips contiguous bytes. | |
| size_t | read (void *buffer, size_t numBytes) |
| Reads contiguous bytes. | |
| size_t | length (void) const |
| Gets contiguous length. | |
| Buffer8 * | push (uint8_t *buf, size_t len, bool ownsData) |
| Pushes a new chunk (sequential mode). | |
| Buffer8 * | push (size_t index, uint8_t *buf, size_t len, bool ownsData) |
| Pushes a new chunk (indexed mode). | |
| virtual void | chunkSkip (size_t offset) |
| Increments offset of current chunk. | |
| size_t | chunkLength (void) |
| Gets current chunk length. | |
| uint8_t * | chunkPtr (void) |
| Gets current chunk pointer. | |
| bool | empty (void) const |
Private Member Functions | |
| void | next (void) |
| Creates next parser, set to nullptr as placeholder, if the parser iterator is at the end. | |
Private Attributes | |
| std::vector< PacketParser * > | parsers_ |
| std::vector< PacketParser * >::iterator | iter_ |
Manages packet buffers and associated packet parsers.
| grk::PacketCache::PacketCache | ( | ) |
Constructs a PacketCache.
| grk::PacketCache::~PacketCache | ( | ) |
Destroys a PacketCache.
References parsers_.
| PacketParser * grk::PacketCache::gen | ( | ITileProcessor * | tileProcessor, |
| uint16_t | packetSequenceNumber, | ||
| uint16_t | compno, | ||
| uint8_t | resno, | ||
| uint64_t | precinctIndex, | ||
| uint16_t | layno, | ||
| uint32_t | cachedLength ) |
Generates a PacketParser if it doesn't exist.
| tileProcessor | TileProcssor |
| packetSequenceNumber | packet sequence number |
| compno | component number |
| resno | resolution number |
| precinctIndex | precinct index |
| layno | layer number |
| cachedLength | signalled length from PLT/PLM marker, or cached length from previous read of header |
References iter_, next(), and parsers_.
Referenced by grk::T2Decompress::parsePacket().
| void grk::PacketCache::next | ( | size_t | offset | ) |
Moves to next chunk / packet buffer and associated PacketParser if present.
If no parser is available, then nullptr is pushed to list of parsers
| offset | remaining bytes in current chunk |
References grk::SparseBuffer::chunkSkip(), next(), and grk::SparseBuffer::offset().
Referenced by grk::T2Decompress::parsePacket().
|
private |
|
overridevirtual |
Resets state to beginning of packet list, and beginning of parser list.
Reimplemented from grk::SparseBuffer.
References iter_, parsers_, and grk::SparseBuffer::rewind().
|
private |
Referenced by gen(), next(), PacketCache(), and rewind().
|
private |
Referenced by gen(), next(), PacketCache(), rewind(), and ~PacketCache().