![]() |
VR-Link API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00009 #pragma once 00010 00011 #include "vlString.h" 00012 00013 00014 #ifdef _WIN32 00015 #include <WinSock2.h> 00016 #else 00017 #include <sys/types.h> 00018 #endif 00019 00020 #ifdef DtUSE_UTILITIES_NAMESPACE 00021 namespace DtUSE_UTILITIES_NAMESPACE 00022 { 00023 #endif 00024 00025 #ifndef _WIN32 00026 key_t DtGetShmKeyFromString(const DtString& name); 00027 #endif 00028 00035 class DT_DLL_VLUTIL DtSharedMemoryPoolManager 00036 { 00037 public: 00038 00044 DtSharedMemoryPoolManager(const DtString& shared_name, unsigned long size); 00045 00047 virtual ~DtSharedMemoryPoolManager(); 00048 00049 private: 00051 DtSharedMemoryPoolManager(const DtSharedMemoryPoolManager &other); 00053 DtSharedMemoryPoolManager& operator=(const DtSharedMemoryPoolManager &other); 00054 00055 public: 00057 void *address() const; 00058 00059 protected: 00060 00061 DtString myName; 00062 void *myAddr; 00063 00064 #ifdef _WIN32 00065 HANDLE myMapFile; 00066 #else 00067 int myId; 00068 #endif 00069 00070 }; 00071 00078 class DT_DLL_VLUTIL DtSharedMemoryPoolClient 00079 { 00080 00081 public: 00082 00085 DtSharedMemoryPoolClient(const DtString& shared_name); 00086 00089 virtual ~DtSharedMemoryPoolClient(); 00090 00091 private: 00092 00094 DtSharedMemoryPoolClient(const DtSharedMemoryPoolClient &other); 00095 00097 DtSharedMemoryPoolClient& operator=(const DtSharedMemoryPoolClient &other); 00098 00099 public: 00100 00102 void *address() const; 00103 00104 protected: 00105 00106 DtString myName; 00107 void *myAddr; 00108 #ifdef _WIN32 00109 HANDLE myMapFile; 00110 #else 00111 int myId; 00112 #endif 00113 }; 00114 00115 #ifdef DtUSE_UTILITIES_NAMESPACE 00116 } 00117 #endif 00118