00001 #if !defined(__EVENTSEMAPHORE_HPP)
00002 #define __EVENTSEMAPHORE_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined(__COMMON_HPP)
00025 #include <Common.hpp>
00026 #endif
00027
00028 #if !defined(__SEMAPHORE_HPP)
00029 #include <Semaphore.hpp>
00030 #endif
00031
00032 namespace corelinux
00033 {
00034 DECLARE_CLASS( EventSemaphore );
00035
00041 class EventSemaphore : public Semaphore
00042 {
00043 public:
00044
00045
00046
00047
00048
00062 EventSemaphore
00063 (
00064 SemaphoreGroupPtr aGroup,
00065 SemaphoreIdentifierRef aIdentifier,
00066 Counter aLimit,
00067 bool aRecursionFlag = true,
00068 bool aBalkingFlag = false
00069 ) throw ( NullPointerException );
00070
00072
00073 virtual ~EventSemaphore( void );
00074
00075
00076
00077
00078
00080
00081 virtual bool isLocked( void ) ;
00082
00083
00084
00085
00086
00091 SemaphoreOperationStatus post( void )
00092 throw( SemaphoreException );
00093
00099 virtual SemaphoreOperationStatus lockWithWait( void )
00100 throw( SemaphoreException );
00101
00106 virtual SemaphoreOperationStatus lockWithNoWait( void )
00107 throw( SemaphoreException );
00108
00110
00111
00112
00113
00115
00116 virtual SemaphoreOperationStatus release( void )
00117 throw( SemaphoreException );
00118
00127 virtual void setLimit ( Counter aLimit ) throw ( SemaphoreException );
00128
00133 virtual Counter getLimit ( void ) const;
00134
00135 protected:
00136
00137
00138
00139
00141
00142 EventSemaphore( void ) throw( Assertion );
00143
00145
00146 EventSemaphore( EventSemaphoreCref ) throw( Assertion );
00147
00148
00149
00150
00152
00153 EventSemaphoreRef operator=( EventSemaphoreCref )
00154 throw( Assertion );
00155
00156 private:
00157
00159
00160 Counter theNumListeners;
00161
00163
00164 Counter theMaxListeners;
00165 };
00166
00167 }
00168
00169 #endif // if !defined(__EVENTSEMAPHORE_HPP)
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179