CoreLinux++  0.4.32
EventSemaphoreGroup.hpp
1 #if !defined(__EVENTSEMAPHOREGROUP_HPP)
2 #define __EVENTSEMAPHOREGROUP_HPP
3 
4 /*
5  CoreLinux++
6  Copyright (C) 1999,2000 CoreLinux Consortium
7 
8  The CoreLinux++ Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12 
13  The CoreLinux++ Library Library is distributed in the hope that it will
14  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public
19  License along with the GNU C Library; see the file COPYING.LIB. If not,
20  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA 02111-1307, USA.
22 */
23 
24 #if !defined(__COMMON_HPP)
25 #include <Common.hpp>
26 #endif
27 
28 #if !defined(__SEMAPHOREGROUP_HPP)
29 #include <SemaphoreGroup.hpp>
30 #endif
31 
32 namespace corelinux
33 {
34  DECLARE_CLASS( EventSemaphoreGroup );
35 
44  {
45  public:
59  (
60  Short aSemCount,
61  Int aRightSet = OWNER_ALL
63 
86  (
87  Short aSemCount,
89  Int aRightSet,
92 
115  (
116  Short aSemCount,
117  CharCptr aName,
118  Int aRightSet,
120  ) throw(Assertion,SemaphoreException);
121 
122 
124 
125  virtual ~EventSemaphoreGroup( void );
126 
127  //
128  // Accessors
129  //
130 
131  //
132  // Factory methods
133  //
134 
142  virtual AbstractSemaphorePtr createSemaphore( void )
143  throw( SemaphoreException ) ;
144 
154  virtual AbstractSemaphorePtr createSemaphore( Counter aLimit )
155  throw( SemaphoreException ) ;
156 
180  (
181  SemaphoreIdentifierRef aIdentifier,
183  bool Recursive = false,
184  bool Balking = false
185  ) throw( SemaphoreException ) ;
186 
214  (
215  SemaphoreIdentifierRef aIdentifier,
216  Counter aLimit,
218  bool Recursive = false,
219  bool Balking = false
220  ) throw( SemaphoreException );
221 
245  (
246  std::string aName,
248  bool Recursive=false,
249  bool Balking = false
250  ) throw( SemaphoreException ) ;
251 
276  (
277  std::string aName,
278  Counter aLimit,
280  bool Recursive=false,
281  bool Balking = false
282  ) throw( SemaphoreException ) ;
283 
284 
292  virtual void destroySemaphore( AbstractSemaphorePtr aPtr )
293  throw( SemaphoreException ) ;
294 
295  protected:
296 
297  //
298  // Constructors
299  //
301 
302  EventSemaphoreGroup( void ) throw( Assertion );
303 
305 
307  throw( Assertion );
308 
309  //
310  // Operator overloadings
311  //
312 
313  // Assignment operator not allowed
314 
316  throw( Assertion );
317 
318  //
319  // EventGroup methods
320  //
321 
322  // Protected method for resolving event between CSA and local
323 
324  AbstractSemaphorePtr resolveSemaphore
325  (
326  SemaphoreIdentifierRef aIdentifier,
327  Short aSemId,
328  CreateDisposition aDisp,
329  bool aRecurse,
330  bool aBalk,
331  Counter aMaxValue = 1
332  ) throw( SemaphoreException ) ;
333 
334  private:
335 
337 
338  SemaphoreShares theUsedMap;
339 
340  };
341 }
342 
343 #endif // if !defined(__EVENTSEMAPHOREGROUP_HPP)
344 
345 /*
346  Common rcs information do not modify
347  $Author: dulimart $
348  $Revision: 1.6 $
349  $Date: 2000/11/13 15:20:25 $
350  $Locker: $
351 */
352 
353 
EventSemaphoreGroup(void)
Default constructor not allowed.
virtual ~EventSemaphoreGroup(void)
Virtual destructor.
Definition: EventSemaphoreGroup.cpp:94
CreateDisposition
Creation dispositions for various system utilities.
Definition: AccessRights.hpp:63
Will throw exception if target exists.
Definition: AccessRights.hpp:71
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
A AbstractSemaphore supports the protocol that processes and/or threads agree to follow for the purpo...
Definition: AbstractSemaphore.hpp:85
virtual AbstractSemaphorePtr createSemaphore(void)
Create a default EventSemaphore.
Definition: EventSemaphoreGroup.cpp:129
Owner has read/write access.
Definition: AccessRights.hpp:43
A EventSemaphoreGroup is an extension to the SemaphoreGroup for creating only EventSemaphore types...
Definition: EventSemaphoreGroup.hpp:43
SemaphoreException is the base exception type for Semaphore.
Definition: SemaphoreException.hpp:39
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
Will create or open.
Definition: AccessRights.hpp:67
virtual void destroySemaphore(AbstractSemaphorePtr aPtr)
Destroys a previously created EventSemaphore.
Definition: EventSemaphoreGroup.cpp:276
A SemaphoreGroup is an extension to the Linux semaphore set.
Definition: SemaphoreGroup.hpp:62

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium