MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #include <vlutil/vlPrint.h>
21 
22 #define DtMetadataAlignNone 0
23 #define DtMetadataAlign16Bit 1
24 #define DtMetadataAlign32Bit 3
25 #define DtMetadataAlign64Bit 7
26 
27 typedef enum DtMetadataTypes_e
28 {
46 
47 
49 
51 
71 typedef struct DtMetadataHeader_s
72 {
74  {
75  DtU16 allFields;
76 
78  {
79 #if DT_LITTLE_ENDIAN
80  DtU16 type : 13;
81  DtU16 hasPayload : 1;
82  DtU16 copy : 1;
83  DtU16 more : 1;
84 #else
85  DtU16 more : 1;
86  DtU16 copy : 1;
87  DtU16 hasPayload : 1;
88  DtU16 type : 13;
89 #endif
90 
91  } field;
92 
93  } ctl;
94 
96  {
97  DtU16 val;
98 
100  {
101 #if DT_LITTLE_ENDIAN
102  DtU16 payloadLen : 11;
103  DtU16 pad : 1;
104  DtU16 alignPad : 2;
105  DtU16 payloadAlignment : 2;
106 #else
107  DtU16 payloadAlignment : 2;
108  DtU16 alignPad : 2;
109  DtU16 pad : 1;
110  DtU16 payloadLen : 11;
111 #endif
112  } len;
113 
114  } lenOrVal;
115 
117 
120 
124 {
125 protected:
126 
127  typedef std::list< DtMetadataNetHeader* > DtMetadataHeaderList;
128 
129 public:
130 
132  DtRtiMetadata( caddr_t msg, DtMetadataType type );
133  DtRtiMetadata( DtRtiMsg* msg, DtMetadataType type );
134 
136  virtual ~DtRtiMetadata();
137 
138 private:
139 
141  DtRtiMetadata(const DtRtiMetadata &);
142 
144  DtRtiMetadata& operator=(const DtRtiMetadata &);
145 
146 public:
147 
151  virtual bool locate( void** mdVal, unsigned int& size ) const;
152 
156  virtual bool nullify();
157 
161  virtual unsigned int remove();
162 
166  virtual unsigned int purge();
167 
169  virtual bool isCopyEnabled();
170  virtual void setCopyEnable( bool copyEnable );
171 
179  virtual bool setLengthAsValue(unsigned int value);
180 
183  virtual bool getLengthAsValue(unsigned int &value) const;
184 
186  virtual void print(MAKRti::DtOutputStream& stream = MAKRti::DtDebug);
187 
188 public:
189 
191  static unsigned int metadataMaxSize();
192 
193 protected:
194 
195  virtual DtMetadataNetHeader* getFirstHeader( ) const;
196  virtual DtMetadataNetHeader* getHeaderByType( ) const;
197  virtual DtU16 compactMetadata( char* dst, DtMetadataHeaderList& retentionPool,
198  bool newFinal );
199 
200 protected:
201 
204  // Returns boolean: type was found?
205  static bool locate( char const* msg, DtMetadataType type,
206  void** mdVal, unsigned int& size );
207 
209  static bool typeIsPresent( char const* msg, DtMetadataType type );
210 
211 
212  static DtMetadataNetHeader* getFirstHeader(char const* msg);
213  static DtMetadataNetHeader* getNextHeader( DtMetadataNetHeader* hdr );
214  static DtMetadataNetHeader* getHeaderByType( char const* msg, DtMetadataType type );
215 
218  static void transmogrifyHeader( DtMetadataNetHeader& src, DtMetadataNetHeader& dest );
219 
222  static void reverseTransmogrifyHeader( DtMetadataNetHeader& src, DtMetadataNetHeader& dest );
223 
224  static unsigned int metadataSize( DtMetadataNetHeader& hdr );
225  static unsigned int metadataPayloadSize( DtMetadataNetHeader& hdr );
226 
227 protected:
228 
230  caddr_t myMsgAddr;
231  mutable unsigned int myMsgLen;
232  char * myStartAddr;
233  unsigned int mySize;
236 
237 protected:
238 
239  static unsigned int theMaxMetadataBufferSize;
240 };
241 
242 #endif

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)