Public Member Functions | |
Listener (int nTargetInit) | |
virtual | ~Listener () |
StrictMutex & | getMutex () |
void | notifyTransferCompletion (bool b) |
void | waitForAll () |
Public Attributes | |
int | nTarget |
int | nSuccess |
int | nCompleted |
Private Attributes | |
StrictMutex | mutex |
LocalCondition | cond |
Definition at line 132 of file RandomAccessFileDeviceTest.cpp.
RandomAccessFileDeviceTest::Listener::Listener | ( | int | nTargetInit | ) | [inline, explicit] |
Definition at line 142 of file RandomAccessFileDeviceTest.cpp.
References nCompleted, nSuccess, and nTarget.
00143 { 00144 nTarget = nTargetInit; 00145 nSuccess = 0; 00146 nCompleted = 0; 00147 }
virtual RandomAccessFileDeviceTest::Listener::~Listener | ( | ) | [inline, virtual] |
StrictMutex& RandomAccessFileDeviceTest::Listener::getMutex | ( | ) | [inline] |
Definition at line 152 of file RandomAccessFileDeviceTest.cpp.
References mutex.
Referenced by RandomAccessFileDeviceTest::testAsyncIOImpl().
00153 { 00154 return mutex; 00155 }
void RandomAccessFileDeviceTest::Listener::notifyTransferCompletion | ( | bool | b | ) | [inline] |
Definition at line 157 of file RandomAccessFileDeviceTest.cpp.
References cond, mutex, nCompleted, nSuccess, and nTarget.
Referenced by RandomAccessFileDeviceTest::Binding::notifyTransferCompletion().
00158 { 00159 StrictMutexGuard mutexGuard(mutex); 00160 if (b) { 00161 nSuccess++; 00162 } 00163 nCompleted++; 00164 if (nCompleted == nTarget) { 00165 cond.notify_all(); 00166 } 00167 }
void RandomAccessFileDeviceTest::Listener::waitForAll | ( | ) | [inline] |
Definition at line 169 of file RandomAccessFileDeviceTest.cpp.
References cond, mutex, nCompleted, and nTarget.
Referenced by RandomAccessFileDeviceTest::testAsyncIOImpl().
00170 { 00171 StrictMutexGuard mutexGuard(mutex); 00172 while (nCompleted < nTarget) { 00173 cond.wait(mutexGuard); 00174 } 00175 }
Definition at line 134 of file RandomAccessFileDeviceTest.cpp.
Referenced by getMutex(), notifyTransferCompletion(), and waitForAll().
Definition at line 135 of file RandomAccessFileDeviceTest.cpp.
Referenced by notifyTransferCompletion(), and waitForAll().
Definition at line 138 of file RandomAccessFileDeviceTest.cpp.
Referenced by Listener(), notifyTransferCompletion(), and waitForAll().
Definition at line 139 of file RandomAccessFileDeviceTest.cpp.
Referenced by Listener(), notifyTransferCompletion(), and RandomAccessFileDeviceTest::testAsyncIOImpl().
Definition at line 140 of file RandomAccessFileDeviceTest.cpp.
Referenced by Listener(), notifyTransferCompletion(), and waitForAll().