Isis 3 Programmer Reference
CubeCachingAlgorithm.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7
8#include "CubeCachingAlgorithm.h"
9
10#include <cstring>
11
12#include <QList>
13
14#include "RawCubeChunk.h"
15
16namespace Isis {
22
23
29
30
38
39
47 m_chunksToFree = NULL;
48 m_chunksToFree = new QList<RawCubeChunk *>(free);
49 }
50
51
58 m_chunksToFree = NULL;
59
60 if(other.m_chunksToFree)
61 m_chunksToFree = new QList<RawCubeChunk *>(*other.m_chunksToFree);
62 }
63
64
69 if(m_chunksToFree) {
70 delete m_chunksToFree;
71 m_chunksToFree = NULL;
72 }
73 }
74
75
84 return (m_chunksToFree != NULL);
85 }
86
87
93 const {
94 QList<RawCubeChunk *> recommended;
95
96 if(m_chunksToFree != NULL)
97 recommended = *m_chunksToFree;
98
99 return recommended;
100 }
101
102
112 delete m_chunksToFree;
113 m_chunksToFree = NULL;
114
115 if(other.m_chunksToFree) {
116 m_chunksToFree = new QList<RawCubeChunk *>;
117 *m_chunksToFree = *other.m_chunksToFree;
118 }
119
120 return *this;
121 }
122}
123
This stores the results of the caching algorithm.
CacheResult & operator=(const CacheResult &other)
Assign one cache result to another.
QList< RawCubeChunk * > getChunksToFree() const
CacheResult()
Construct a cache algorithm result with the idea that the algorithm did not understand/was unable to ...
bool algorithmUnderstoodData() const
If this is true, then the results (be them empty or not) should be considered valid.
virtual ~CacheResult()
Free allocated memory.
QList< RawCubeChunk * > * m_chunksToFree
If NULL, the algorithm did not succeed.
CubeCachingAlgorithm()
Construct a caching algorithm.
virtual ~CubeCachingAlgorithm()
Cleans up after a caching algorithm.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16