EventSemaphoreGroup.hpp

00001 #if   !defined(__EVENTSEMAPHOREGROUP_HPP)
00002 #define __EVENTSEMAPHOREGROUP_HPP
00003 
00004 /*
00005   CoreLinux++ 
00006   Copyright (C) 1999,2000 CoreLinux Consortium
00007   
00008    The CoreLinux++ Library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public License as
00010    published by the Free Software Foundation; either version 2 of the
00011    License, or (at your option) any later version.
00012 
00013    The CoreLinux++ Library Library is distributed in the hope that it will 
00014    be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public
00019    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00020    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021    Boston, MA 02111-1307, USA.  
00022 */
00023 
00024 #if   !defined(__COMMON_HPP)
00025 #include <Common.hpp>
00026 #endif
00027 
00028 #if   !defined(__SEMAPHOREGROUP_HPP)
00029 #include <SemaphoreGroup.hpp>
00030 #endif
00031 
00032 namespace corelinux
00033 {
00034    DECLARE_CLASS( EventSemaphoreGroup );
00035 
00043    class EventSemaphoreGroup : public SemaphoreGroup
00044    {
00045    public:
00058                EventSemaphoreGroup
00059                   ( 
00060                      Short aSemCount, 
00061                      Int aRightSet = OWNER_ALL 
00062                   ) throw(Assertion,SemaphoreException);
00063 
00085                EventSemaphoreGroup
00086                   (
00087                      Short aSemCount,
00088                      SemaphoreGroupIdentifierCref aGID,
00089                      Int aRightSet,
00090                      CreateDisposition disp=FAIL_IF_EXISTS
00091                   ) throw(Assertion,SemaphoreException);
00092 
00114                EventSemaphoreGroup
00115                   (
00116                      Short aSemCount,
00117                      CharCptr aName,
00118                      Int aRightSet,
00119                      CreateDisposition disp=FAIL_IF_EXISTS
00120                   ) throw(Assertion,SemaphoreException);
00121 
00122 
00124 
00125       virtual  ~EventSemaphoreGroup( void );
00126 
00127                      //
00128                      // Accessors
00129                      //
00130 
00131                      //
00132                      // Factory methods
00133                      //
00134 
00142       virtual  AbstractSemaphorePtr createSemaphore( void )
00143                   throw( SemaphoreException ) ;
00144 
00154       virtual  AbstractSemaphorePtr createSemaphore( Counter aLimit )
00155                   throw( SemaphoreException ) ;
00156 
00179       virtual  AbstractSemaphorePtr createSemaphore
00180                   ( 
00181                      SemaphoreIdentifierRef aIdentifier,
00182                      CreateDisposition disp = CREATE_OR_REUSE,
00183                      bool Recursive = false, 
00184                      bool Balking = false 
00185                   ) throw( SemaphoreException ) ;
00186 
00213       virtual  AbstractSemaphorePtr createSemaphore
00214                   ( 
00215                      SemaphoreIdentifierRef aIdentifier,
00216                      Counter aLimit, 
00217                      CreateDisposition disp = CREATE_OR_REUSE,
00218                      bool Recursive = false, 
00219                      bool Balking = false 
00220                   ) throw( SemaphoreException );
00221 
00244       virtual  AbstractSemaphorePtr createSemaphore
00245                   ( 
00246                      std::string aName,
00247                      CreateDisposition disp = CREATE_OR_REUSE,
00248                      bool Recursive=false, 
00249                      bool Balking = false 
00250                   ) throw( SemaphoreException ) ;
00251 
00275       virtual  AbstractSemaphorePtr createSemaphore
00276                   (
00277                      std::string aName,
00278                      Counter aLimit, 
00279                      CreateDisposition disp = CREATE_OR_REUSE,
00280                      bool Recursive=false, 
00281                      bool Balking = false 
00282                   ) throw( SemaphoreException ) ;
00283 
00284 
00292       virtual  void  destroySemaphore( AbstractSemaphorePtr aPtr )
00293                         throw( SemaphoreException ) ;
00294 
00295    protected:
00296 
00297       //
00298       // Constructors
00299       //
00301 
00302                EventSemaphoreGroup( void ) throw( Assertion );
00303 
00305 
00306                EventSemaphoreGroup( EventSemaphoreGroupCref ) 
00307                   throw( Assertion );
00308 
00309       //
00310       // Operator overloadings
00311       //
00312 
00313                // Assignment operator not allowed
00314 
00315                EventSemaphoreGroupRef operator=( EventSemaphoreGroupCref )
00316                   throw( Assertion );
00317 
00318       //
00319       // EventGroup methods
00320       //
00321 
00322                // Protected method for resolving event between CSA and local
00323 
00324                AbstractSemaphorePtr resolveSemaphore
00325                   (
00326                      SemaphoreIdentifierRef  aIdentifier,
00327                      Short                   aSemId,
00328                      CreateDisposition       aDisp,
00329                      bool                    aRecurse, 
00330                      bool                    aBalk,
00331                      Counter                 aMaxValue = 1
00332                   ) throw( SemaphoreException ) ;
00333 
00334    private:
00335 
00337 
00338       SemaphoreShares   theUsedMap;
00339 
00340    };
00341 }
00342 
00343 #endif // if !defined(__EVENTSEMAPHOREGROUP_HPP)
00344 
00345 /*
00346    Common rcs information do not modify
00347    $Author: dulimart $
00348    $Revision: 1.6 $
00349    $Date: 2000/11/13 15:20:25 $
00350    $Locker:  $
00351 */
00352 
00353 

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