2002-07-13 00:30:45 +04:00
|
|
|
#ifndef _beos_locker_sync_object_h_
|
|
|
|
#define _beos_locker_sync_object_h_
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#include <cppunit/SynchronizedObject.h>
|
|
|
|
#include <Locker.h>
|
|
|
|
|
2002-07-11 07:28:37 +04:00
|
|
|
//! BLocker based implementation of CppUnit::SynchronizedObject::SynchronizationObject
|
|
|
|
/*! This class is used to serialize access to a TestResult object. You should
|
|
|
|
not need to explicitly use it anywhere in your testing code.
|
2002-07-09 16:24:59 +04:00
|
|
|
*/
|
2004-02-19 00:38:04 +03:00
|
|
|
class CPPUNIT_API LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
|
2002-07-09 16:24:59 +04:00
|
|
|
public:
|
|
|
|
LockerSyncObject() {}
|
|
|
|
virtual ~LockerSyncObject() {}
|
|
|
|
|
|
|
|
virtual void lock() { fLock.Lock(); }
|
|
|
|
virtual void unlock() { fLock.Unlock(); }
|
2002-07-11 07:28:37 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
protected:
|
|
|
|
BLocker fLock;
|
2002-07-11 07:28:37 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
//! Prevents the use of the copy constructor.
|
|
|
|
LockerSyncObject( const LockerSyncObject © );
|
|
|
|
|
|
|
|
//! Prevents the use of the copy operator.
|
|
|
|
void operator =( const LockerSyncObject © );
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _beos_synchronization_object_h_
|