CoreLinux++  0.4.32
MutexSemaphoreGroup.hpp
1 #if !defined(__MUTEXSEMAPHOREGROUP_HPP)
2 #define __MUTEXSEMAPHOREGROUP_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 
35  DECLARE_CLASS( MutexSemaphoreGroup );
36 
45  {
46  public:
47 
60  MutexSemaphoreGroup( Short, Int Rights = OWNER_ALL )
62 
86  (
87  Short,
89  Int ,
92 
112  (
113  Short,
114  CharCptr,
115  Int ,
117  ) throw(Assertion,SemaphoreException);
118 
119 
121 
122  virtual ~MutexSemaphoreGroup( void );
123 
124  //
125  // Accessors
126  //
127 
128  //
129  // Factory methods
130  //
131 
138  virtual AbstractSemaphorePtr createSemaphore( void )
139  throw( SemaphoreException ) ;
140 
148  (
149  bool Recursive = false,
150  bool Balking = false
151  ) throw( SemaphoreException ) ;
152 
171  (
172  SemaphoreIdentifierRef aIdentifier,
174  bool Recursive = false,
175  bool Balking = false
176  ) throw( SemaphoreException ) ;
177 
197  (
198  SemaphoreIdentifierRef aIdentifier,
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  MutexSemaphoreGroup( void ) throw( Assertion );
249 
251 
253  throw( Assertion );
254 
255  //
256  // Operator overloads
257  //
258 
260 
262  throw( Assertion );
263 
265 
267  (
268  SemaphoreIdentifierRef aIdentifier,
269  Short aSemId,
270  CreateDisposition aDisp,
271  bool aRecurse,
272  bool aBalk,
273  bool aAutoLock = false
274  ) throw( SemaphoreException ) ;
275 
276  private:
277 
279 
280  SemaphoreShares theUsedMap;
281 
282  };
283 }
284 
285 #endif // if !defined(__MUTEXSEMAPHOREGROUP_HPP)
286 
287 /*
288  Common rcs information do not modify
289  $Author: frankc $
290  $Revision: 1.4 $
291  $Date: 2000/06/04 22:16:32 $
292  $Locker: $
293 */
294 
295 
AbstractSemaphorePtr resolveSemaphore(SemaphoreIdentifierRef aIdentifier, Short aSemId, CreateDisposition aDisp, bool aRecurse, bool aBalk, bool aAutoLock=false)
Protected method for resolving mutex between CSA and local.
Definition: MutexSemaphoreGroup.cpp:305
virtual AbstractSemaphorePtr createLockedSemaphore(bool Recursive=false, bool Balking=false)
Create a locked MutexSemaphore.
Definition: MutexSemaphoreGroup.cpp:139
MutexSemaphoreGroup(void)
Default constructor not allowed.
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
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
virtual ~MutexSemaphoreGroup(void)
Virtual destructor.
Definition: MutexSemaphoreGroup.cpp:91
virtual AbstractSemaphorePtr createSemaphore(void)
Create a default MutexSemaphore.
Definition: MutexSemaphoreGroup.cpp:128
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)
Destroys a created MutexSemaphore.
Definition: MutexSemaphoreGroup.cpp:246
A MutexSemaphoreGroup is an extension to the SemaphoreGroup for creating only MutexSemaphore types...
Definition: MutexSemaphoreGroup.hpp:44
MutexSemaphoreGroupRef operator=(MutexSemaphoreGroupCref)
Assignment operator not allowed.
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