![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 2005 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: vlShmPool__rti__.h,v $ $Revision: 1.3 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef vlShmPool__rti___H_ 00010 #define vlShmPool__rti___H_ 00011 00015 00016 #include "rtiMsConfig.h" 00017 #include <vlutil/vlString.h> 00018 00019 00020 #if _WIN32 00021 #include <WinSock2.h> 00022 #else 00023 #include <sys/types.h> 00024 #endif 00025 00026 #ifdef DtUSE_UTILITIES_NAMESPACE 00027 namespace DtUSE_UTILITIES_NAMESPACE 00028 { 00029 #endif 00030 00031 #ifndef _WIN32 00032 key_t DtGetShmKeyFromString(const MAKRti::DtString& name); 00033 #endif 00034 00047 00048 typedef enum DtShmPoolCreationMode_enum 00049 { 00050 DtShmPoolCreationMode_Normal, 00051 DtShmPoolCreationMode_Exclusive, 00052 DtShmPoolCreationMode_GracefulTakeover, 00053 DtShmPoolCreationMode_RuthlessTakeover 00054 } DtShmPoolCreationMode; 00055 00057 // 00062 class DT_DLL_RTIUTIL DtSharedMemoryPoolManager__rti__ 00063 { 00064 public: 00065 00071 DtSharedMemoryPoolManager__rti__(const MAKRti::DtString& shared_name, unsigned long size, 00072 DtShmPoolCreationMode create = DtShmPoolCreationMode_Normal); 00073 00075 virtual ~DtSharedMemoryPoolManager__rti__(); 00076 00077 private: 00079 DtSharedMemoryPoolManager__rti__(const DtSharedMemoryPoolManager__rti__ &other); 00081 DtSharedMemoryPoolManager__rti__& operator=(const DtSharedMemoryPoolManager__rti__ &other); 00082 00083 public: 00085 void *address() const; 00086 00087 protected: 00088 00089 MAKRti::DtString myName; 00090 void *myAddr; 00091 00092 #if _WIN32 00093 HANDLE myMapFile; 00094 HANDLE myManagerFile; 00095 #else 00096 int myId; 00097 #endif 00098 00099 }; 00100 00102 // 00107 class DT_DLL_RTIUTIL DtSharedMemoryPoolClient__rti__ 00108 { 00109 00110 public: 00111 00114 DtSharedMemoryPoolClient__rti__(const MAKRti::DtString& shared_name); 00115 00118 virtual ~DtSharedMemoryPoolClient__rti__(); 00119 00120 private: 00121 00123 DtSharedMemoryPoolClient__rti__(const DtSharedMemoryPoolClient__rti__ &other); 00124 00126 DtSharedMemoryPoolClient__rti__& operator=(const DtSharedMemoryPoolClient__rti__ &other); 00127 00128 public: 00129 00131 void *address() const; 00132 00133 protected: 00134 00135 MAKRti::DtString myName; 00136 void *myAddr; 00137 #if _WIN32 00138 HANDLE myMapFile; 00139 #else 00140 int myId; 00141 #endif 00142 }; 00143 00144 #ifdef DtUSE_UTILITIES_NAMESPACE 00145 } 00146 #endif 00147 00148 00149 #endif