![]() |
VR-Link API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00008 #pragma once 00009 00010 #include "vlMachineTypes.h" 00011 00012 #ifdef DtUSE_UTILITIES_NAMESPACE 00013 namespace DtUSE_UTILITIES_NAMESPACE 00014 { 00015 #endif 00016 00017 typedef struct DtBufferPlaceHolder *DtBufferPtr; 00018 #define DtUSE_INTERNAL_BUFFER_REP 0 00019 #ifdef DtUSE_UTILITIES_NAMESPACE 00020 #define DtUSE_INTERNAL_BUFFER (DtUSE_UTILITIES_NAMESPACE::DtBufferPtr(0)) 00021 #else 00022 #define DtUSE_INTERNAL_BUFFER (DtBufferPtr(0)) 00023 #endif 00024 00027 class DT_DLL_VLUTIL DtBaseMsg 00028 { 00029 public: 00030 00032 virtual ~DtBaseMsg(); 00033 00035 DtBaseMsg(const DtBaseMsg& msg, 00036 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00037 00039 DtBaseMsg &operator=(const DtBaseMsg& msg); 00040 00042 virtual const char* netRep() const; 00043 00045 virtual int length() const; 00046 00047 protected: 00048 00051 DtBaseMsg(); 00052 00053 void initMsg(int size, DtBufferPtr bufferPtr); 00054 void initMsg(const void *initial, 00055 int size, DtBufferPtr bufferPtr); 00056 00062 virtual void changeSize(int size); 00063 00067 virtual void insertBytes(int offset, int numBytes); 00068 00072 virtual void insertBytes(void *address, int numBytes); 00073 00076 virtual void deleteBytes(int offset, int numBytes); 00077 00081 virtual void deleteBytes(void *address, int numBytes); 00082 00084 virtual void clearAll(); 00085 00089 virtual void *newInternalBuffer(int size); 00090 00093 virtual void sizeChanged(int size) = 0; 00094 00095 protected: 00096 00097 void *myNetMsg; 00098 void *myInternalBuff; 00099 int myIntBuffSize; 00100 int myMsgSize; 00101 }; 00102 00103 00104 inline const char* DtBaseMsg::netRep() const 00105 { 00106 return (char*) myNetMsg; 00107 } 00108 00109 #ifdef DtUSE_UTILITIES_NAMESPACE 00110 } 00111 #endif