00001 /*************************************************************************** 00002 LOW_semaphoreSetFactory.h - description 00003 ------------------- 00004 begin : Tue Jul 30 2002 00005 copyright : (C) 2002 by Harald Roelle, Helmut Reiser 00006 email : roelle@informatik.uni-muenchen.de, reiser@informatik.uni-muenchen.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef LOW_SEMAPHORESETFACTORY_H 00019 #define LOW_SEMAPHORESETFACTORY_H 00020 00021 00022 #include "LOW_semaphoreSet.h" 00023 00024 00025 00026 /** Factory class for platform specific objects of LOW_semaphoreSet. 00027 00028 This class also contains platform specific type definitions. 00029 00030 @see LOW_semaphoreSet 00031 00032 @author Harald Roelle, Helmut Reiser 00033 */ 00034 class LOW_semaphoreSetFactory { 00035 00036 //======================================================================================= 00037 public: 00038 00039 //===================================================================================== 00040 // 00041 // type definitions 00042 // 00043 00044 #ifdef __linux__ 00045 /** Linux specific type for semaphore set unique identifier. */ 00046 typedef key_t semSetIPCKey_t; 00047 #endif 00048 00049 //===================================================================================== 00050 // 00051 // static factory 00052 // 00053 00054 /** Get maximum number of semaphores in set (platform aware). 00055 @return Maximum number of semaphores in set. 00056 */ 00057 static int getMaxSemaphoresPerSet(); 00058 00059 /** Platform aware replacement for creating dynamic instances of LOW_semaphoreSet. 00060 @param inSemSetIPCKey Unique identifier for new shared memory segment. 00061 To get such an identifier see LOW_IPCKeyGenerator. 00062 @param inCount Number of semaphores in set. 00063 @param inInit Initial values of semaphores. 00064 @return Pointer to new instance of LOW_semaphoreSet. 00065 */ 00066 static LOW_semaphoreSet* new_semaphoreSet( const semSetIPCKey_t inSemSetIPCKey, 00067 unsigned int inCount, unsigned int inInit); 00068 }; 00069 00070 #endif