QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgschunklist_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgschunklist_p.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSCHUNKLIST_P_H
17#define QGSCHUNKLIST_P_H
18
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the QGIS API. It exists purely as an
26// implementation detail. This header file may change from version to
27// version without notice, or even be removed.
28//
29
30#define SIP_NO_FILE
31
32class QgsChunkNode;
33
41struct QgsChunkListEntry
42{
44 QgsChunkListEntry( QgsChunkNode *node )
45 : chunk( node )
46 {
47 }
48
49 QgsChunkListEntry *prev = nullptr;
50 QgsChunkListEntry *next = nullptr;
51 QgsChunkNode *chunk;
52};
53
54
68class QgsChunkList
69{
70 public:
72 QgsChunkList() = default;
73
75 int trueCount() const;
77 int count() const { return mCount; }
78
80 QgsChunkListEntry *first() const { return mHead; }
82 QgsChunkListEntry *last() const { return mTail; }
84 bool isEmpty() const;
85
90 void insertEntry( QgsChunkListEntry *entry, QgsChunkListEntry *next );
91
93 void takeEntry( QgsChunkListEntry *entry );
95 QgsChunkListEntry *takeFirst();
97 QgsChunkListEntry *takeLast();
98
100 void insertFirst( QgsChunkListEntry *entry );
102 void insertLast( QgsChunkListEntry *entry );
103
104 private:
105 QgsChunkListEntry *mHead = nullptr;
106 QgsChunkListEntry *mTail = nullptr;
107 int mCount = 0;
108};
109
111
112#endif // QGSCHUNKLIST_P_H