MAK RTIspy API Documentation for HLA Evolved
metadata.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2006 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: metadata.h,v $ $Revision: 1.8 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef DtRtiMetadata_H_
10 #define DtRtiMetadata_H_
11 
16 
17 #include <list>
18 #include <internalTypes.h>
19 #include "rtiMsg.h"
20 
21 #define DtMetadataAlignNone 0
22 #define DtMetadataAlign16Bit 1
23 #define DtMetadataAlign32Bit 3
24 #define DtMetadataAlign64Bit 7
25 
26 typedef enum DtMetadataTypes_e
27 {
45 
46 
48 
50 
70 typedef struct DtMetadataHeader_s
71 {
73  {
74  DtU16 allFields;
75 
77  {
78 #if DT_LITTLE_ENDIAN
79  DtU16 type : 13;
80  DtU16 hasPayload : 1;
81  DtU16 copy : 1;
82  DtU16 more : 1;
83 #else
84  DtU16 more : 1;
85  DtU16 copy : 1;
86  DtU16 hasPayload : 1;
87  DtU16 type : 13;
88 #endif
89 
90  } field;
91 
92  } ctl;
93 
95  {
96  DtU16 val;
97 
99  {
100 #if DT_LITTLE_ENDIAN
101  DtU16 payloadLen : 11;
102  DtU16 pad : 1;
103  DtU16 alignPad : 2;
104  DtU16 payloadAlignment : 2;
105 #else
106  DtU16 payloadAlignment : 2;
107  DtU16 alignPad : 2;
108  DtU16 pad : 1;
109  DtU16 payloadLen : 11;
110 #endif
111  } len;
112 
113  } lenOrVal;
114 
116 
119 
123 {
124 protected:
125 
126  typedef std::list< DtMetadataNetHeader* > DtMetadataHeaderList;
127 
128 public:
129 
131  DtRtiMetadata( caddr_t msg, DtMetadataType type );
132  DtRtiMetadata( DtRtiMsg* msg, DtMetadataType type );
133 
135  virtual ~DtRtiMetadata();
136 
137 private:
138 
140  DtRtiMetadata(const DtRtiMetadata &);
141 
143  DtRtiMetadata& operator=(const DtRtiMetadata &);
144 
145 public:
146 
150  virtual bool locate( void** mdVal, unsigned int& size ) const;
151 
155  virtual bool nullify();
156 
160  virtual unsigned int remove();
161 
165  virtual unsigned int purge();
166 
168  virtual bool isCopyEnabled();
169  virtual void setCopyEnable( bool copyEnable );
170 
178  virtual bool setLengthAsValue(unsigned int value);
179 
182  virtual bool getLengthAsValue(unsigned int &value) const;
183 
184 public:
185 
187  static unsigned int metadataMaxSize();
188 
189 protected:
190 
191  virtual DtMetadataNetHeader* getFirstHeader( ) const;
192  virtual DtMetadataNetHeader* getHeaderByType( ) const;
193  virtual DtU16 compactMetadata( char* dst, DtMetadataHeaderList& retentionPool,
194  bool newFinal );
195 
196 protected:
197 
200  // Returns boolean: type was found?
201  static bool locate( char const* msg, DtMetadataType type,
202  void** mdVal, unsigned int& size );
203 
205  static bool typeIsPresent( char const* msg, DtMetadataType type );
206 
207 
208  static DtMetadataNetHeader* getFirstHeader(char const* msg);
209  static DtMetadataNetHeader* getNextHeader( DtMetadataNetHeader* hdr );
210  static DtMetadataNetHeader* getHeaderByType( char const* msg, DtMetadataType type );
211 
214  static void transmogrifyHeader( DtMetadataNetHeader& src, DtMetadataNetHeader& dest );
215 
218  static void reverseTransmogrifyHeader( DtMetadataNetHeader& src, DtMetadataNetHeader& dest );
219 
220  static unsigned int metadataSize( DtMetadataNetHeader& hdr );
221  static unsigned int metadataPayloadSize( DtMetadataNetHeader& hdr );
222 
223 protected:
224 
226  caddr_t myMsgAddr;
227  mutable unsigned int myMsgLen;
228  char * myStartAddr;
229  unsigned int mySize;
232 
233 protected:
234 
235  static unsigned int theMaxMetadataBufferSize;
236 };
237 
238 #endif

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)