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 
16 namespace Isis {
21  }
22 
23 
28  }
29 
30 
36  m_chunksToFree = NULL;
37  }
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 
Isis::CubeCachingAlgorithm::CacheResult::getChunksToFree
QList< RawCubeChunk * > getChunksToFree() const
Definition: CubeCachingAlgorithm.cpp:92
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::CubeCachingAlgorithm::CacheResult::~CacheResult
virtual ~CacheResult()
Free allocated memory.
Definition: CubeCachingAlgorithm.cpp:68
Isis::CubeCachingAlgorithm::CacheResult
This stores the results of the caching algorithm.
Definition: CubeCachingAlgorithm.h:45
Isis::CubeCachingAlgorithm::~CubeCachingAlgorithm
virtual ~CubeCachingAlgorithm()
Cleans up after a caching algorithm.
Definition: CubeCachingAlgorithm.cpp:27
Isis::CubeCachingAlgorithm::CubeCachingAlgorithm
CubeCachingAlgorithm()
Construct a caching algorithm.
Definition: CubeCachingAlgorithm.cpp:20
Isis::CubeCachingAlgorithm::CacheResult::m_chunksToFree
QList< RawCubeChunk * > * m_chunksToFree
If NULL, the algorithm did not succeed.
Definition: CubeCachingAlgorithm.h:62
Isis::CubeCachingAlgorithm::CacheResult::operator=
CacheResult & operator=(const CacheResult &other)
Assign one cache result to another.
Definition: CubeCachingAlgorithm.cpp:111
Isis::CubeCachingAlgorithm::CacheResult::algorithmUnderstoodData
bool algorithmUnderstoodData() const
If this is true, then the results (be them empty or not) should be considered valid.
Definition: CubeCachingAlgorithm.cpp:83
Isis::CubeCachingAlgorithm::CacheResult::CacheResult
CacheResult()
Construct a cache algorithm result with the idea that the algorithm did not understand/was unable to ...
Definition: CubeCachingAlgorithm.cpp:35
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16