Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qsharedmemory_p.h 3.3.8 edited Jan 11 14:46 $ 00003 ** 00004 ** Includes system files for shared memory 00005 ** 00006 ** Created : 020124 00007 ** 00008 ** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved. 00009 ** 00010 ** This file is part of the kernel module of the Qt GUI Toolkit. 00011 ** 00012 ** This file may be distributed and/or modified under the terms of the 00013 ** GNU General Public License version 2 as published by the Free Software 00014 ** Foundation and appearing in the file LICENSE.GPL included in the 00015 ** packaging of this file. 00016 ** 00017 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 00018 ** licenses for Qt/Embedded may use this file in accordance with the 00019 ** Qt Embedded Commercial License Agreement provided with the Software. 00020 ** 00021 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00022 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00023 ** 00024 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00025 ** information about Qt Commercial License Agreements. 00026 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00027 ** 00028 ** Contact info@trolltech.com if any conditions of this licensing are 00029 ** not clear to you. 00030 ** 00031 **********************************************************************/ 00032 00033 #ifndef QSHAREDMEMORY_P_H 00034 #define QSHAREDMEMORY_P_H 00035 00036 // 00037 // W A R N I N G 00038 // ------------- 00039 // 00040 // This file is not part of the Qt API. It exists for the convenience 00041 // of qapplication_qws.cpp and qgfxvnc_qws.cpp. This header file may 00042 // change from version to version without notice, or even be removed. 00043 // 00044 // We mean it. 00045 // 00046 // 00047 00048 #ifndef QT_H 00049 #include "qstring.h" 00050 #endif // QT_H 00051 00052 #if !defined (QT_QWS_NO_SHM) 00053 00054 #include <sys/types.h> 00055 #include <sys/ipc.h> 00056 00057 class QSharedMemory { 00058 public: 00059 QSharedMemory(){}; 00060 QSharedMemory(int, QString, char c = 'Q'); 00061 ~QSharedMemory(){}; 00062 00063 bool create(); 00064 void destroy(); 00065 00066 bool attach(); 00067 void detach(); 00068 00069 void setPermissions(mode_t mode); 00070 int size(); 00071 void * base() { return shmBase; }; 00072 00073 private: 00074 void *shmBase; 00075 int shmSize; 00076 QString shmFile; 00077 char character; 00078 #if defined(QT_POSIX_QSHM) 00079 int shmFD; 00080 #else 00081 int shmId; 00082 key_t key; 00083 int idInitted; 00084 #endif 00085 }; 00086 00087 #endif 00088 00089 #endif