00001 #if !defined(__GUARDSEMAPHORE_HPP) 00002 #define __GUARDSEMAPHORE_HPP 00003 00004 #if !defined(__COMMON_HPP) 00005 #include <Common.hpp> 00006 #endif 00007 00008 #if !defined(__SEMAPHORE_HPP) 00009 #include <Semaphore.hpp> 00010 #endif 00011 00012 namespace corelinux 00013 { 00014 DECLARE_CLASS( GuardSemaphore ); 00015 00025 class GuardSemaphore : public Semaphore 00026 { 00027 public: 00028 00029 // 00030 // Constructors and destructors 00031 // 00032 00042 GuardSemaphore 00043 ( 00044 SemaphoreGroupPtr, 00045 SemaphoreIdentifierRef 00046 ) throw(Assertion); 00047 00049 00050 virtual ~GuardSemaphore( void ); 00051 00052 // 00053 // Mutators 00054 // 00055 00057 00058 virtual SemaphoreOperationStatus lockWithWait(void) 00059 throw(SemaphoreException); 00060 00062 00063 virtual SemaphoreOperationStatus lockWithNoWait(void) 00064 throw(SemaphoreException); 00065 00067 00068 virtual bool isLocked(void) ; 00069 00071 00072 // virtual SemaphoreOperationStatus lockWithTimeOut( Timer ) 00073 // throw(SemaphoreException) = 0; 00074 00076 00077 virtual SemaphoreOperationStatus release(void) 00078 throw(SemaphoreException); 00079 00080 protected: 00081 00082 // 00083 // Constructors 00084 // 00085 00087 00088 GuardSemaphore( void ) 00089 throw(Assertion); 00090 00092 00093 GuardSemaphore( GuardSemaphoreCref ) 00094 throw(Assertion); 00095 00096 // 00097 // Operator overloads 00098 // 00100 00101 GuardSemaphoreRef operator=( GuardSemaphoreCref ) 00102 throw(Assertion); 00103 00104 }; 00105 } 00106 00107 #endif 00108 00109 /* 00110 Common rcs information do not modify 00111 $Author: frankc $ 00112 $Revision: 1.2 $ 00113 $Date: 2000/06/02 11:51:52 $ 00114 $Locker: $ 00115 */ 00116 00117