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) 1992-2013 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
addShort(
short
value);
99
103
virtual
void
addLong(
long
value);
104
108
virtual
void
addFloat(
float
value);
109
114
virtual
void
addString(
const
DtString
& str);
115
116
//{@
129
virtual
bool
pullShort(
short
& value,
unsigned
int
& byteoffset)
const
;
130
virtual
bool
pullLong(
long
& value,
unsigned
int
& byteoffset)
const
;
131
virtual
bool
pullFloat(
float
& value,
unsigned
int
& byteoffset)
const
;
132
virtual
bool
pullString(
DtString
& value,
unsigned
int
& byteoffset)
const
;
134
135
//{@
137
virtual
void
getData(
unsigned
char
* buff)
const
;
138
virtual
void
* data();
139
void
setData(
unsigned
char
* data,
int
numBytes);
141
143
virtual
void
printData
()
const
;
144
146
virtual
void
printDataToStream
(std::ostream& stream)
const
;
147
148
149
public
:
151
static
DtPdu
* create(
const
DtNetPacket
* initial,
152
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
153
155
static
void
addCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
156
void
* usr);
157
159
static
void
removeCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
160
void
* usr);
161
164
static
void
addCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
165
void
* usr,
DtDIGuyCustomPduMsgId
id
);
166
169
static
void
removeCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
170
void
* usr,
DtDIGuyCustomPduMsgId
id
);
171
176
static
void
setCustomPduKind(
DtPduKind
pduKind);
177
static
DtPduKind
customPduKind();
178
179
protected
:
180
virtual
DtPduKind
internalGetPduKind
()
const
;
181
182
protected
:
183
static
DtPduKind
theCustomPduKind
;
184
};
185
186
187
#endif
Document ID: Generated on Mon Apr 8 04:49:21 EDT 2019 from SVN revision 197403
Copyright © 2005-2016 VT MÄK. All Rights Reserved (
www.mak.com
)