Grok 20.3.2
PacketCache.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2026 Grok Image Compression Inc.
3 *
4 * This source code is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License, version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This source code is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Affero General Public License for more details.
12 *
13 * You should have received a copy of the GNU Affero General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#pragma once
19
20#include "PacketParser.h"
21
22namespace grk
23{
24
30{
31public:
36
41
47 void next(size_t offset);
48
53 void rewind(void) override;
54
66 PacketParser* gen(ITileProcessor* tileProcessor, uint16_t packetSequenceNumber, uint16_t compno,
67 uint8_t resno, uint64_t precinctIndex, uint16_t layno, uint32_t cachedLength);
68
69private:
75 void next(void);
76
77 std::vector<PacketParser*> parsers_;
78 std::vector<PacketParser*>::iterator iter_;
79};
80
81} // namespace grk
PacketCache()
Constructs a PacketCache.
Definition PacketCache.cpp:29
void rewind(void) override
Resets state to beginning of packet list, and beginning of parser list.
Definition PacketCache.cpp:47
void next(void)
Creates next parser, set to nullptr as placeholder, if the parser iterator is at the end.
Definition PacketCache.cpp:69
std::vector< PacketParser * >::iterator iter_
Definition PacketCache.h:78
~PacketCache()
Destroys a PacketCache.
Definition PacketCache.cpp:35
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.
Definition PacketCache.cpp:53
std::vector< PacketParser * > parsers_
Definition PacketCache.h:77
Parses packet header and packer data.
Definition PacketParser.h:35
SparseBuffer()
Constructs a SparseBuffer.
Definition SparseBuffer.cpp:42
size_t offset(void)
Gets contiguous offset.
Definition SparseBuffer.cpp:239
ResWindow.
Definition CompressedChunkCache.h:36
Interface for managing tile compression/decompression.
Definition ITileProcessor.h:37