Isis 3 Programmer Reference
|
#include <CubeDataThreadTester.h>
Public Slots | |
void | ReadBrick (void *requester, int cubeId, const Isis::Brick *data) |
This is called when a brick is read. More... | |
void | ReadWriteBrick (void *requester, int cubeId, Isis::Brick *data) |
This is called when a brick is given for R/W. More... | |
void | BrickChanged (int cubeId, const Isis::Brick *data) |
This is called when a brick is written. More... | |
Signals | |
void | RequestReadCube (int cubeId, int startSample, int startLine, int endSample, int endLine, int band, void *caller) |
Ask for a brick for reading. More... | |
void | RequestReadWriteCube (int cubeId, int startSample, int startLine, int endSample, int endLine, int band, void *caller) |
Ask for a brick for reading and writing. More... | |
void | NotifyDoneWithData (int, const Isis::Brick *) |
Let the cube data thread know we're no longer working with a particular brick. More... | |
Public Member Functions | |
CubeDataThreadTester (CubeDataThread *) | |
This initializes a CubeDataThreadTester. More... | |
virtual | ~CubeDataThreadTester () |
This cleans up the cube data thread. More... | |
int | NumberOfTestsDone () |
Returns the number of tests done (testing methods count as several) More... | |
CubeDataThread * | DataThread () |
Returns the cube data thread being tested. More... | |
void | Connect () |
This connects this class' signals and slots with CubeDataThread's signals and slots. More... | |
void | ReadCubeTest (int) |
This tests a basic read. More... | |
void | ReadCubeTest2 (int, int) |
This tests two basic reads with no conflicts. More... | |
void | ReadCubeTest3 (int) |
This tests an overlapping read. More... | |
void | WriteCubeTest (int) |
This tests a basic write. More... | |
void | WriteCubeTest2 (int, int) |
This tests two non-conflicting writes. More... | |
void | WriteCubeTest3 (int) |
This tests two conflicting* writes. More... | |
void | WriteCubeTest3BreakDeadlock () |
This test breaks the deadlock caused by the third write test. More... | |
void | NotifyChangeTest (int) |
This test tests this automatic change notifications. More... | |
Private Member Functions | |
void | run () |
This thread is centered completely around its event loop. More... | |
Private Attributes | |
int | p_numTestsDone |
The count of completed tests. More... | |
CubeDataThread * | p_cubeDataThread |
The data thread being tested. More... | |
bool | p_execStarted |
True if this thread is started. More... | |
bool | p_notifyDone |
True if we will notify done on the next brick received for R/W. More... | |
QVector< QPair< int, const Isis::Brick * > > * | p_cachedDoneBricks |
A list of bricks we haven't send the done signal for. More... | |
Definition at line 25 of file CubeDataThreadTester.h.
Isis::CubeDataThreadTester::CubeDataThreadTester | ( | CubeDataThread * | testObject | ) |
This initializes a CubeDataThreadTester.
The CubeDataThread given is the subject of the tests.
testObject | The CubeDataThread instance to be tested |
Definition at line 33 of file CubeDataThreadTester.cpp.
References p_cachedDoneBricks, p_cubeDataThread, p_execStarted, p_notifyDone, and p_numTestsDone.
|
virtual |
This cleans up the cube data thread.
Definition at line 78 of file CubeDataThreadTester.cpp.
References p_execStarted.
|
slot |
This is called when a brick is written.
Definition at line 360 of file CubeDataThreadTester.cpp.
References Isis::Buffer::at(), NotifyDoneWithData(), p_numTestsDone, and Isis::Buffer::size().
Referenced by NotifyChangeTest().
void Isis::CubeDataThreadTester::Connect | ( | ) |
This connects this class' signals and slots with CubeDataThread's signals and slots.
Definition at line 52 of file CubeDataThreadTester.cpp.
References NotifyDoneWithData(), p_cubeDataThread, ReadBrick(), ReadWriteBrick(), RequestReadCube(), and RequestReadWriteCube().
|
inline |
Returns the cube data thread being tested.
Definition at line 38 of file CubeDataThreadTester.h.
References p_cubeDataThread.
void Isis::CubeDataThreadTester::NotifyChangeTest | ( | int | cubeId | ) |
This test tests this automatic change notifications.
This performs 2 tests.
cubeId | The identifier given by the data thread for the file to test |
Definition at line 206 of file CubeDataThreadTester.cpp.
References Isis::CubeDataThread::AddChangeListener(), BrickChanged(), p_cubeDataThread, and RequestReadWriteCube().
|
signal |
Let the cube data thread know we're no longer working with a particular brick.
Referenced by BrickChanged(), Connect(), ReadBrick(), ReadWriteBrick(), and WriteCubeTest3BreakDeadlock().
|
inline |
Returns the number of tests done (testing methods count as several)
Definition at line 33 of file CubeDataThreadTester.h.
References p_numTestsDone.
|
slot |
This is called when a brick is read.
Definition at line 228 of file CubeDataThreadTester.cpp.
References Isis::Buffer::at(), NotifyDoneWithData(), p_cachedDoneBricks, p_notifyDone, p_numTestsDone, and Isis::Buffer::size().
Referenced by Connect().
void Isis::CubeDataThreadTester::ReadCubeTest | ( | int | cubeId | ) |
This tests a basic read.
This performs 1 test.
cubeId | The identifier given by the data thread for the file to test |
Definition at line 99 of file CubeDataThreadTester.cpp.
References RequestReadCube().
void Isis::CubeDataThreadTester::ReadCubeTest2 | ( | int | cubeId1, |
int | cubeId2 | ||
) |
This tests two basic reads with no conflicts.
This performs 2 tests.
Definition at line 111 of file CubeDataThreadTester.cpp.
References p_notifyDone, and RequestReadCube().
void Isis::CubeDataThreadTester::ReadCubeTest3 | ( | int | cubeId | ) |
This tests an overlapping read.
This performs 2 tests.
cubeId | The identifier given by the data thread for the file to test |
Definition at line 126 of file CubeDataThreadTester.cpp.
References p_notifyDone, and RequestReadCube().
|
slot |
This is called when a brick is given for R/W.
Definition at line 283 of file CubeDataThreadTester.cpp.
References Isis::Buffer::at(), NotifyDoneWithData(), p_cachedDoneBricks, p_notifyDone, p_numTestsDone, and Isis::Buffer::size().
Referenced by Connect().
|
signal |
Ask for a brick for reading.
cubeId | Cube identifier |
startSample | Brick starting sample |
startLine | Brick starting line |
endSample | Brick ending sample |
endLine | Brick ending line |
band | Brick band |
caller | A this pointer |
Referenced by Connect(), ReadCubeTest(), ReadCubeTest2(), ReadCubeTest3(), and WriteCubeTest().
|
signal |
Ask for a brick for reading and writing.
cubeId | Cube identifier |
startSample | Brick starting sample |
startLine | Brick starting line |
endSample | Brick ending sample |
endLine | Brick ending line |
band | Brick band |
caller | A this pointer |
Referenced by Connect(), NotifyChangeTest(), WriteCubeTest(), WriteCubeTest2(), and WriteCubeTest3().
|
private |
This thread is centered completely around its event loop.
returns the cube id
Definition at line 89 of file CubeDataThreadTester.cpp.
References p_execStarted.
void Isis::CubeDataThreadTester::WriteCubeTest | ( | int | cubeId | ) |
This tests a basic write.
This performs 2 tests.
cubeId | The identifier given by the data thread for the file to test |
Definition at line 141 of file CubeDataThreadTester.cpp.
References RequestReadCube(), and RequestReadWriteCube().
void Isis::CubeDataThreadTester::WriteCubeTest2 | ( | int | cubeId1, |
int | cubeId2 | ||
) |
This tests two non-conflicting writes.
This performs 2 tests.
Definition at line 154 of file CubeDataThreadTester.cpp.
References p_notifyDone, and RequestReadWriteCube().
void Isis::CubeDataThreadTester::WriteCubeTest3 | ( | int | cubeId | ) |
This tests two conflicting* writes.
This causes a deadlock!
This performs a test, deadlocks, and once the deadlock is broken (via WriteCubeTest3BreakDeadlock), finishes another test.
cubeId | The identifier given by the data thread for the file to test |
Definition at line 172 of file CubeDataThreadTester.cpp.
References p_notifyDone, and RequestReadWriteCube().
void Isis::CubeDataThreadTester::WriteCubeTest3BreakDeadlock | ( | ) |
This test breaks the deadlock caused by the third write test.
Definition at line 186 of file CubeDataThreadTester.cpp.
References NotifyDoneWithData(), and p_cachedDoneBricks.
|
private |
A list of bricks we haven't send the done signal for.
Definition at line 111 of file CubeDataThreadTester.h.
Referenced by CubeDataThreadTester(), ReadBrick(), ReadWriteBrick(), and WriteCubeTest3BreakDeadlock().
|
private |
The data thread being tested.
Definition at line 102 of file CubeDataThreadTester.h.
Referenced by Connect(), CubeDataThreadTester(), DataThread(), and NotifyChangeTest().
|
private |
True if this thread is started.
Definition at line 105 of file CubeDataThreadTester.h.
Referenced by CubeDataThreadTester(), run(), and ~CubeDataThreadTester().
|
private |
True if we will notify done on the next brick received for R/W.
Definition at line 108 of file CubeDataThreadTester.h.
Referenced by CubeDataThreadTester(), ReadBrick(), ReadCubeTest2(), ReadCubeTest3(), ReadWriteBrick(), WriteCubeTest2(), and WriteCubeTest3().
|
private |
The count of completed tests.
Definition at line 99 of file CubeDataThreadTester.h.
Referenced by BrickChanged(), CubeDataThreadTester(), NumberOfTestsDone(), ReadBrick(), and ReadWriteBrick().