00001 /*************************************************************************** 00002 LOW_sharedMemSegmentSysV.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_SHAREDMEMSEGMENT_SYSV_H 00019 #define LOW_SHAREDMEMSEGMENT_SYSV_H 00020 00021 00022 #include "LOW_sharedMemSegment.h" 00023 #include "LOW_sharedMemSegmentFactory.h" 00024 00025 00026 /** Platform specific sharedMemSegment for Unix System V platforms. 00027 00028 @author Harald Roelle, Helmut Reiser 00029 */ 00030 class LOW_sharedMemSegment_SysV : public LOW_sharedMemSegment { 00031 00032 //======================================================================================= 00033 public: 00034 00035 //===================================================================================== 00036 // 00037 // constructors 00038 // 00039 00040 /** Constructor. 00041 @param inSharedMemIPCKey Unique identifier for new shared memory segment. 00042 To get such an identifier see LOW_IPCKeyGenerator. 00043 @param inSize Size of the segment in bytes. 00044 */ 00045 LOW_sharedMemSegment_SysV( const LOW_sharedMemSegmentFactory::sharedMemSegmentIPCKey_t inKey, 00046 const unsigned int inSize); 00047 00048 /** Destructor. 00049 */ 00050 virtual ~LOW_sharedMemSegment_SysV(); 00051 00052 00053 //===================================================================================== 00054 // 00055 // methods 00056 // 00057 00058 void* get() const; 00059 00060 00061 //======================================================================================= 00062 private: 00063 00064 //===================================================================================== 00065 // 00066 // constants 00067 // 00068 00069 static const int SHM_PERMS = 0770; /**< Permissions for the shm segments. */ 00070 00071 00072 //===================================================================================== 00073 // 00074 // attributes 00075 // 00076 00077 const key_t sharedMemSegKey; /**< IPC key of the segment. */ 00078 int sharedMemSegID; /**< Sys V segment ID. */ 00079 void* sharedMemPtr; /**< Pointer to the segment. */ 00080 }; 00081 00082 #endif