CoreLinux++  0.4.32
GatewaySemaphoreGroup.hpp
1 #if !defined(__GATEWAYSEMAPHOREGROUP_HPP)
2 #define __GATEWAYSEMAPHOREGROUP_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( GatewaySemaphoreGroup );
35 
45  {
46  public:
47 
60  GatewaySemaphoreGroup( Short, Int Rights = OWNER_ALL )
62 
86  (
87  Short,
89  Int ,
92 
112  (
113  Short,
114  CharCptr aName,
115  Int ,
117  ) throw(Assertion,SemaphoreException);
118 
119 
121 
122  virtual ~GatewaySemaphoreGroup( void );
123 
124  //
125  // Accessors
126  //
127 
128  //
129  // Factory methods
130  //
131 
138  virtual AbstractSemaphorePtr createSemaphore( void )
139  throw( SemaphoreException ) ;
140 
148  virtual AbstractSemaphorePtr createCountSemaphore( Count aCount )
149  throw( SemaphoreException ) ;
150 
169  (
170  SemaphoreIdentifierRef aIdentifier,
172  bool Recursive = false,
173  bool Balking = false
174  ) throw( SemaphoreException ) ;
175 
196  (
197  SemaphoreIdentifierRef aIdentifier,
198  Count aCount,
200  bool Recursive = false,
201  bool Balking = false
202  ) throw( SemaphoreException ) ;
221  (
222  std::string aName,
224  bool Recursive=false,
225  bool Balking = false
226  ) throw( SemaphoreException ) ;
227 
228 
239  virtual void destroySemaphore( AbstractSemaphorePtr )
240  throw( SemaphoreException ) ;
241  protected:
242 
243  //
244  // Constructors
245  //
247 
248  GatewaySemaphoreGroup( void ) throw( Assertion );
249 
251 
253  throw( Assertion );
254 
255  //
256  // Operator overloads
257  //
258 
260 
262  throw( Assertion );
263 
264  //
265  // GatewayGroup methods
266  //
267 
269 
271  (
272  SemaphoreIdentifierRef aIdentifier,
273  Short aSemId,
274  CreateDisposition aDisp,
275  bool aRecurse,
276  bool aBalk,
277  Count aMaxValue = 1
278  ) throw( SemaphoreException ) ;
279 
280  private:
281 
283 
284  SemaphoreShares theUsedMap;
285 
286  };
287 }
288 
289 #endif // if !defined(__GATEWAYSEMAPHOREGROUP_HPP)
290 
291 /*
292  Common rcs information do not modify
293  $Author: frankc $
294  $Revision: 1.4 $
295  $Date: 2000/06/04 22:16:32 $
296  $Locker: $
297 */
298 
299 
virtual ~GatewaySemaphoreGroup(void)
Virtual destructor.
Definition: GatewaySemaphoreGroup.cpp:92
A GatewaySemaphoreGroup is an extension to the SemaphoreGroup for creating only GatewaySemaphore type...
Definition: GatewaySemaphoreGroup.hpp:44
AbstractSemaphorePtr resolveSemaphore(SemaphoreIdentifierRef aIdentifier, Short aSemId, CreateDisposition aDisp, bool aRecurse, bool aBalk, Count aMaxValue=1)
Protected method for resolving mutex between CSA and local.
Definition: GatewaySemaphoreGroup.cpp:295
virtual AbstractSemaphorePtr createSemaphore(void)
Create a default GatewaySemaphore.
Definition: GatewaySemaphoreGroup.cpp:127
virtual void destroySemaphore(AbstractSemaphorePtr)
Destroys a created GatewaySemaphore.
Definition: GatewaySemaphoreGroup.cpp:237
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
Owner has read/write access.
Definition: AccessRights.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
GatewaySemaphoreGroupRef operator=(GatewaySemaphoreGroupCref)
Assignment operator not allowed.
virtual AbstractSemaphorePtr createCountSemaphore(Count aCount)
Create a count GatewaySemaphore.
Definition: GatewaySemaphoreGroup.cpp:137
A SemaphoreGroup is an extension to the Linux semaphore set.
Definition: SemaphoreGroup.hpp:62
GatewaySemaphoreGroup(void)
Default constructor not allowed.

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