xref: /haiku/headers/tools/cppunit/LockerSyncObject.h (revision 1b89aa98ffe3057ab801dab67b9f5de6d1f933a5)
10a99bdf4STyler Dauwalder #ifndef _beos_locker_sync_object_h_
20a99bdf4STyler Dauwalder #define _beos_locker_sync_object_h_
352a38012Sejakowatz 
452a38012Sejakowatz #include <cppunit/SynchronizedObject.h>
552a38012Sejakowatz #include <Locker.h>
652a38012Sejakowatz 
7530d2bc9STyler Dauwalder //! BLocker based implementation of CppUnit::SynchronizedObject::SynchronizationObject
8530d2bc9STyler Dauwalder /*!	This class is used to serialize access to a TestResult object. You should
9530d2bc9STyler Dauwalder 	not need to explicitly use it anywhere in your testing code.
1052a38012Sejakowatz */
11*1b89aa98SIngo Weinhold class CPPUNIT_API LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
1252a38012Sejakowatz public:
LockerSyncObject()1352a38012Sejakowatz 	LockerSyncObject() {}
~LockerSyncObject()1452a38012Sejakowatz 	virtual ~LockerSyncObject() {}
1552a38012Sejakowatz 
lock()1652a38012Sejakowatz 	virtual void lock() { fLock.Lock(); }
unlock()1752a38012Sejakowatz 	virtual void unlock() { fLock.Unlock(); }
18530d2bc9STyler Dauwalder 
1952a38012Sejakowatz protected:
2052a38012Sejakowatz 	BLocker fLock;
21530d2bc9STyler Dauwalder 
22530d2bc9STyler Dauwalder private:
23530d2bc9STyler Dauwalder   //! Prevents the use of the copy constructor.
24530d2bc9STyler Dauwalder   LockerSyncObject( const LockerSyncObject &copy );
25530d2bc9STyler Dauwalder 
26530d2bc9STyler Dauwalder   //! Prevents the use of the copy operator.
27530d2bc9STyler Dauwalder   void operator =( const LockerSyncObject &copy );
28530d2bc9STyler Dauwalder 
2952a38012Sejakowatz };
3052a38012Sejakowatz 
3152a38012Sejakowatz #endif  // _beos_synchronization_object_h_
32