00001 /*************************************************************************** 00002 LOW_sharedMemSegmentFactory.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_SHAREDMEMSEGMENTFACTORY_H 00019 #define LOW_SHAREDMEMSEGMENTFACTORY_H 00020 00021 00022 #include <sys/types.h> 00023 00024 #include "LOW_sharedMemSegment.h" 00025 00026 00027 00028 /** Factory class for platform specific objects of LOW_sharedMemSegment. 00029 00030 This class also contains platform specific type definitions. 00031 00032 @see LOW_sharedMemSegment 00033 00034 @author Harald Roelle, Helmut Reiser 00035 */ 00036 class LOW_sharedMemSegmentFactory { 00037 00038 //======================================================================================= 00039 public: 00040 00041 //===================================================================================== 00042 // 00043 // type definitions 00044 // 00045 00046 #ifdef __linux__ 00047 /** Linux specific type for shared memory unique identifier. */ 00048 typedef key_t sharedMemSegmentIPCKey_t; 00049 #endif 00050 00051 //===================================================================================== 00052 // 00053 // static factory 00054 // 00055 00056 /** Platform aware replacement for creating dynamic instances of LOW_sharedMemSegment. 00057 @param inSharedMemIPCKey Unique identifier for new shared memory segment. 00058 To get such an identifier see LOW_IPCKeyGenerator. 00059 @param inSize Size of the segment in bytes. 00060 @return Pointer to new instance of LOW_sharedMemSegment. 00061 */ 00062 static LOW_sharedMemSegment* new_sharedMemSegment( const sharedMemSegmentIPCKey_t inSharedMemIPCKey, unsigned int inSize); 00063 00064 }; 00065 00066 #endif