VR-Link API Documentation for DIS
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vl
diGuyCustomPdu.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (c) 2020 VT MAK
3
* All rights reserved.
4
****************************************************************************/
5
6
#pragma once
7
8
#if DtDIS
9
10
#include <
vl/stateMsgDIS.h
>
11
#include <
vlpi/entityIdentifier.h
>
12
13
class
DtExerciseConn
;
14
15
17
typedef
struct
DtNetDIGuyCustomPdu
18
{
19
DtNetPduHeader
DtHeader
;
20
DtNetU16
DtDIGuyMessageVersion
;
21
DtNetU16
DtDIGuyMessageId
;
22
DtNetEntityIdentifier
DtEntityId
;
23
DtNetU8
DtDataSize
;
24
DtNetU8
DtData
[1];
25
}
DtNetDIGuyCustomPdu
;
26
27
28
class
DtDIGuyCustomPdu
;
29
32
typedef
void (*
DtDIGuyCustomPduCb
)(
DtDIGuyCustomPdu
* pdu,
void
* usr);
33
37
class
DT_DLL_VL
DtDIGuyCustomPdu
:
public
DtStateMsg
38
{
39
public
:
41
enum
{ PduStaticSize = 23 };
42
43
public
:
46
DtDIGuyCustomPdu
(
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
);
47
49
DtDIGuyCustomPdu
(
const
DtNetDIGuyCustomPdu
* initial,
50
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
51
53
virtual
~
DtDIGuyCustomPdu
();
54
56
DtDIGuyCustomPdu
(
const
DtDIGuyCustomPdu
& other);
57
59
DtDIGuyCustomPdu
&
operator=
(
const
DtDIGuyCustomPdu
& other);
60
61
//{@
63
virtual
DtNetDIGuyCustomPdu
* netDIGuyCustomPdu();
64
virtual
const
DtNetDIGuyCustomPdu
* netDIGuyCustomPdu()
const
;
66
67
// MJI - I think this should always be 7, according to the SDK
68
// User's Guide. Going to set it to 7 by default for now, and
69
// this probably shouldn't be changed.
70
//{@
73
virtual
void
setMessageVersion(
int
version);
74
virtual
int
messageVersion()
const
;
76
77
//{@
79
virtual
void
setMessageId(
DtDIGuyCustomPduMsgId
msgId);
80
virtual
DtDIGuyCustomPduMsgId
messageId()
const
;
82
83
//{@
85
virtual
void
setEntityId(
const
DtEntityIdentifier
& entId);
86
virtual
DtEntityIdentifier
entityId()
const
;
88
89
//{@
91
virtual
void
setDataSize(
unsigned
int
size);
92
virtual
unsigned
int
dataSize()
const
;
94
98
virtual
void
addBool(
bool
value);
99
103
virtual
void
addShort(
short
value);
104
108
virtual
void
addLong(
long
value);
109
113
virtual
void
addFloat(
float
value);
114
119
virtual
void
addString(
const
DtString
& str);
120
124
virtual
void
addUnsignedData(
int
size,
const
unsigned
char
* s);
125
126
//{@
139
virtual
bool
pullBool(
bool
& value,
unsigned
int
& byteoffset )
const
;
140
virtual
bool
pullShort(
short
& value,
unsigned
int
& byteoffset )
const
;
141
virtual
bool
pullLong(
long
& value,
unsigned
int
& byteoffset )
const
;
142
virtual
bool
pullFloat(
float
& value,
unsigned
int
& byteoffset )
const
;
143
virtual
bool
pullString(
DtString
& value,
unsigned
int
& byteoffset )
const
;
144
virtual
bool
pullUnsignedData(
const
unsigned
char
*& value,
unsigned
int
& byteoffset,
int
& bytes_read )
const
;
146
147
//{@
149
virtual
void
getData(
unsigned
char
* buff)
const
;
150
virtual
void
* data();
151
void
setData(
unsigned
char
* data,
int
numBytes);
153
155
virtual
void
printData
()
const
;
156
158
virtual
void
printDataToStream
(std::ostream& stream)
const
;
159
160
161
public
:
163
static
DtPdu
* create(
const
DtNetPacket
* initial,
164
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
165
167
static
void
addCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
168
void
* usr);
169
171
static
void
removeCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
172
void
* usr);
173
176
static
void
addCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
177
void
* usr,
DtDIGuyCustomPduMsgId
id
);
178
181
static
void
removeCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
182
void
* usr,
DtDIGuyCustomPduMsgId
id
);
183
188
static
void
setCustomPduKind(
DtPduKind
pduKind);
189
static
DtPduKind
customPduKind();
190
191
protected
:
192
virtual
DtPduKind
internalGetPduKind
()
const
;
193
194
protected
:
195
static
DtPduKind
theCustomPduKind
;
196
};
197
198
199
#endif
Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (
www.mak.com
)