MAK RTIspy API Documentation for HLA 1516
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
libsrc
RTI
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
{
29
DtMetadataTypeNull
= 0,
30
DtMetadataTypeDestinationList
,
31
DtMetadataTypeTransport
,
32
DtMetadataTypeMcastAddr
,
33
DtMetadataTypeFwderGroupId
,
34
DtMetadataTypeTestId
,
35
DtMetadataTypeTimeStampInitiatorSendInteraction
,
36
DtMetadataTypeTimeStampInitiatorNetSend
,
37
DtMetadataTypeTimeStampRecipientNetRead
,
38
DtMetadataTypeTimeStampRecipientAsynchronousQueue
,
39
DtMetadataTypeTimeStampRecipientReceiveInteraction
,
40
DtMetadataTypeTimeStampRecipientSendInteraction
,
41
DtMetadataTypeTimeStampRecipientNetSend
,
42
DtMetadataTypeTimeStampInitiatorNetRead
,
43
DtMetadataTypeTimeStampInitiatorAsynchronousQueue
,
44
DtMetadataTypeTimeStampInitiatorReceiveInteraction
,
45
DtMetadataTypeFederateStateInfo
,
46
47
48
DtMetadataTypeEnd
= 8191
49
50
}
DtMetadataType
;
51
71
typedef
struct
DtMetadataHeader_s
72
{
73
union
DtMetadataHeaderCtl_u
74
{
75
DtU16
allFields
;
76
77
struct
DtMetadataHeaderCtl_s
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
95
union
DtMetadataHeaderLenOrVal_u
96
{
97
DtU16
val
;
98
99
struct
DtMetadataHeaderPayloadLen_s
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
116
}
DtMetadataNetHeader
;
117
120
123
class
DT_DLL_LRC
DtRtiMetadata
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
229
DtRtiMsg
*
myMsg
;
230
caddr_t
myMsgAddr
;
231
mutable
unsigned
int
myMsgLen
;
232
char
*
myStartAddr
;
233
unsigned
int
mySize
;
234
bool
myCopyEnabled
;
235
const
DtMetadataType
myMetaDataType
;
236
237
protected
:
238
239
static
unsigned
int
theMaxMetadataBufferSize
;
240
};
241
242
#endif
Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (
www.mak.com
)