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
: 9;
81
DtU16
hasPayload
: 1;
82
DtU16
payloadAlignment
: 4;
83
DtU16
copy
: 1;
84
DtU16
more
: 1;
85
#else
86
DtU16
more
: 1;
87
DtU16
copy
: 1;
88
DtU16
payloadAlignment
: 4;
89
DtU16
hasPayload
: 1;
90
DtU16
type
: 9;
91
#endif
92
93
}
field
;
94
95
}
ctl
;
96
97
union
DtMetadataHeaderLenOrVal_u
98
{
99
DtU16
val
;
100
101
struct
DtMetadataHeaderPayloadLen_s
102
{
103
#if DT_LITTLE_ENDIAN
104
DtU16
payloadLen
: 11;
105
DtU16
pad
: 1;
106
DtU16
alignPad
: 4;
107
#else
108
DtU16
alignPad
: 4;
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
189
virtual
DtNetMsgHeader
* netMessageHeader();
190
191
public
:
192
194
static
unsigned
int
metadataMaxSize();
195
196
protected
:
197
198
virtual
DtMetadataNetHeader
* getFirstHeader( )
const
;
199
virtual
DtMetadataNetHeader
* getHeaderByType( )
const
;
200
virtual
DtU16 compactMetadata(
char
* dst,
DtMetadataHeaderList
& retentionPool,
201
bool
newFinal );
202
203
protected
:
204
207
// Returns boolean: type was found?
208
static
bool
locate(
char
const
* msg,
DtMetadataType
type,
209
void
** mdVal,
unsigned
int
& size );
210
212
static
bool
typeIsPresent(
char
const
* msg,
DtMetadataType
type );
213
214
215
static
DtMetadataNetHeader
* getFirstHeader(
char
const
* msg);
216
static
DtMetadataNetHeader
* getNextHeader(
DtMetadataNetHeader
* hdr );
217
static
DtMetadataNetHeader
* getHeaderByType(
char
const
* msg,
DtMetadataType
type );
218
221
static
void
transmogrifyHeader(
DtMetadataNetHeader
& src,
DtMetadataNetHeader
& dest );
222
225
static
void
reverseTransmogrifyHeader(
DtMetadataNetHeader
& src,
DtMetadataNetHeader
& dest );
226
227
static
unsigned
int
metadataSize(
DtMetadataNetHeader
& hdr );
228
static
unsigned
int
metadataPayloadSize(
DtMetadataNetHeader
& hdr );
229
230
protected
:
231
232
DtRtiMsg
*
myMsg
;
233
caddr_t
myMsgAddr
;
234
mutable
unsigned
int
myMsgLen
;
235
char
*
myStartAddr
;
236
unsigned
int
mySize
;
237
bool
myCopyEnabled
;
238
const
DtMetadataType
myMetaDataType
;
239
240
protected
:
241
242
static
unsigned
int
theMaxMetadataBufferSize
;
243
};
244
245
#endif
Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (
www.mak.com
)