xref: /haiku/headers/tools/cppunit/LockerSyncObject.h (revision 1b89aa98ffe3057ab801dab67b9f5de6d1f933a5)
1 #ifndef _beos_locker_sync_object_h_
2 #define _beos_locker_sync_object_h_
3 
4 #include <cppunit/SynchronizedObject.h>
5 #include <Locker.h>
6 
7 //! BLocker based implementation of CppUnit::SynchronizedObject::SynchronizationObject
8 /*!	This class is used to serialize access to a TestResult object. You should
9 	not need to explicitly use it anywhere in your testing code.
10 */
11 class CPPUNIT_API LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
12 public:
LockerSyncObject()13 	LockerSyncObject() {}
~LockerSyncObject()14 	virtual ~LockerSyncObject() {}
15 
lock()16 	virtual void lock() { fLock.Lock(); }
unlock()17 	virtual void unlock() { fLock.Unlock(); }
18 
19 protected:
20 	BLocker fLock;
21 
22 private:
23   //! Prevents the use of the copy constructor.
24   LockerSyncObject( const LockerSyncObject &copy );
25 
26   //! Prevents the use of the copy operator.
27   void operator =( const LockerSyncObject &copy );
28 
29 };
30 
31 #endif  // _beos_synchronization_object_h_
32