Isis 3 Programmer Reference
Isis::CubeCachingAlgorithm::CacheResult Class Reference

This stores the results of the caching algorithm. More...

#include <CubeCachingAlgorithm.h>

Collaboration diagram for Isis::CubeCachingAlgorithm::CacheResult:
Collaboration graph

Public Member Functions

 CacheResult ()
 Construct a cache algorithm result with the idea that the algorithm did not understand/was unable to determine a good result for what to free.
 
 CacheResult (QList< RawCubeChunk * >)
 Construct a cache algorithm result with the idea that the algorithm did understand/was able to determine a good result for what to free.
 
 CacheResult (const CacheResult &other)
 Copy a CacheResult.
 
virtual ~CacheResult ()
 Free allocated memory.
 
bool algorithmUnderstoodData () const
 If this is true, then the results (be them empty or not) should be considered valid.
 
QList< RawCubeChunk * > getChunksToFree () const
 
CacheResultoperator= (const CacheResult &other)
 Assign one cache result to another.
 

Private Attributes

QList< RawCubeChunk * > * m_chunksToFree
 If NULL, the algorithm did not succeed.
 

Detailed Description

This stores the results of the caching algorithm.

Author
????-??-?? Jai Rideout and Steven Lambright
History
2011-08-26 Steven Lambright and Jai Rideout - Fixed memory leak.

Definition at line 45 of file CubeCachingAlgorithm.h.

Constructor & Destructor Documentation

◆ CacheResult() [1/3]

Isis::CubeCachingAlgorithm::CacheResult::CacheResult ( )

Construct a cache algorithm result with the idea that the algorithm did not understand/was unable to determine a good result for what to free.

Definition at line 35 of file CubeCachingAlgorithm.cpp.

References m_chunksToFree.

◆ CacheResult() [2/3]

Isis::CubeCachingAlgorithm::CacheResult::CacheResult ( QList< RawCubeChunk * > free)

Construct a cache algorithm result with the idea that the algorithm did understand/was able to determine a good result for what to free.

The list may be empty. Typically, if your result uses this constructor, other algorithms will not be subsequently called.

Definition at line 46 of file CubeCachingAlgorithm.cpp.

◆ CacheResult() [3/3]

Isis::CubeCachingAlgorithm::CacheResult::CacheResult ( const CacheResult & other)

Copy a CacheResult.

Parameters
otherThe result we're copying into ourselves

Definition at line 57 of file CubeCachingAlgorithm.cpp.

◆ ~CacheResult()

Isis::CubeCachingAlgorithm::CacheResult::~CacheResult ( )
virtual

Free allocated memory.

Definition at line 68 of file CubeCachingAlgorithm.cpp.

Member Function Documentation

◆ algorithmUnderstoodData()

bool Isis::CubeCachingAlgorithm::CacheResult::algorithmUnderstoodData ( ) const

If this is true, then the results (be them empty or not) should be considered valid.

If this is false, then the results are empty and the caching algorithm failed.

Returns
True if the recommendation is valid

Definition at line 83 of file CubeCachingAlgorithm.cpp.

Referenced by Isis::CubeIoHandler::minimizeCache().

◆ getChunksToFree()

QList< RawCubeChunk * > Isis::CubeCachingAlgorithm::CacheResult::getChunksToFree ( ) const
Returns
list of RawCubeChunks to remove from RAM according to this caching algorithm. Valid if algorithmUnderstoodData() is true.

Definition at line 92 of file CubeCachingAlgorithm.cpp.

Referenced by Isis::CubeIoHandler::minimizeCache().

◆ operator=()

CubeCachingAlgorithm::CacheResult & Isis::CubeCachingAlgorithm::CacheResult::operator= ( const CacheResult & other)

Assign one cache result to another.

Parameters
otherThe RHS of the assignment operator; the cache result we're copying from.
Returns
A reference to *this

Definition at line 111 of file CubeCachingAlgorithm.cpp.

References m_chunksToFree.

Member Data Documentation

◆ m_chunksToFree

QList<RawCubeChunk *>* Isis::CubeCachingAlgorithm::CacheResult::m_chunksToFree
private

If NULL, the algorithm did not succeed.

If allocated, then this is a valid list of which chunks should be freed from memory.

Definition at line 62 of file CubeCachingAlgorithm.h.

Referenced by CacheResult(), and operator=().


The documentation for this class was generated from the following files: