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
28
enum
DtDIGuyCustomPduMsgId
29
{
30
DtDIGuyMsgIdEscapeReserved
= 0,
31
DtDIGuyMsgIdSetCharType
= 1,
32
DtDIGuyMsgIdSetCharAppearance
= 2,
33
DtDIGuyMsgIdSetCharAction
= 3,
34
DtDIGuyMsgIdSetCharVisible
= 4
35
};
36
37
class
DtDIGuyCustomPdu
;
38
41
typedef
void (*
DtDIGuyCustomPduCb
)(
DtDIGuyCustomPdu
* pdu,
void
* usr);
42
46
class
DT_DLL_VL
DtDIGuyCustomPdu
:
public
DtStateMsg
47
{
48
public
:
50
enum
{ PduStaticSize = 23 };
51
52
public
:
55
DtDIGuyCustomPdu
(
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
);
56
58
DtDIGuyCustomPdu
(
const
DtNetDIGuyCustomPdu
* initial,
59
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
60
62
virtual
~
DtDIGuyCustomPdu
();
63
65
DtDIGuyCustomPdu
(
const
DtDIGuyCustomPdu
& other);
66
68
DtDIGuyCustomPdu
&
operator=
(
const
DtDIGuyCustomPdu
& other);
69
70
//{@
72
virtual
DtNetDIGuyCustomPdu
* netDIGuyCustomPdu();
73
virtual
const
DtNetDIGuyCustomPdu
* netDIGuyCustomPdu()
const
;
75
76
// MJI - I think this should always be 7, according to the SDK
77
// User's Guide. Going to set it to 7 by default for now, and
78
// this probably shouldn't be changed.
79
//{@
82
virtual
void
setMessageVersion(
int
version);
83
virtual
int
messageVersion()
const
;
85
86
//{@
88
virtual
void
setMessageId(
DtDIGuyCustomPduMsgId
msgId);
89
virtual
DtDIGuyCustomPduMsgId
messageId()
const
;
91
92
//{@
94
virtual
void
setEntityId(
const
DtEntityIdentifier
& entId);
95
virtual
DtEntityIdentifier
entityId()
const
;
97
98
//{@
100
virtual
void
setDataSize(
unsigned
int
size);
101
virtual
unsigned
int
dataSize()
const
;
103
107
virtual
void
addShort(
short
value);
108
112
virtual
void
addLong(
long
value);
113
117
virtual
void
addFloat(
float
value);
118
123
virtual
void
addString(
const
DtString
& str);
124
125
//{@
138
virtual
bool
pullShort(
short
& value,
unsigned
int
& byteoffset)
const
;
139
virtual
bool
pullLong(
long
& value,
unsigned
int
& byteoffset)
const
;
140
virtual
bool
pullFloat(
float
& value,
unsigned
int
& byteoffset)
const
;
141
virtual
bool
pullString(
DtString
& value,
unsigned
int
& byteoffset)
const
;
143
144
//{@
146
virtual
void
getData(
unsigned
char
* buff)
const
;
147
virtual
void
* data();
148
void
setData(
unsigned
char
* data,
int
numBytes);
150
152
virtual
void
printData
()
const
;
153
155
virtual
void
printDataToStream
(std::ostream& stream)
const
;
156
157
158
public
:
160
static
DtPdu
* create(
const
DtNetPacket
* initial,
161
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
162
164
static
void
addCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
165
void
* usr);
166
168
static
void
removeCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
169
void
* usr);
170
173
static
void
addCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
174
void
* usr,
DtDIGuyCustomPduMsgId
id
);
175
178
static
void
removeCallback(
DtExerciseConn
* conn,
DtDIGuyCustomPduCb
cb,
179
void
* usr,
DtDIGuyCustomPduMsgId
id
);
180
185
static
void
setCustomPduKind(
DtPduKind
pduKind);
186
static
DtPduKind
customPduKind();
187
188
protected
:
189
virtual
DtPduKind
internalGetPduKind
()
const
;
190
191
protected
:
192
static
DtPduKind
theCustomPduKind
;
193
};
194
195
196
#endif
Document ID: Generated on Mon Feb 6 18:36:34 EST 2017 from SVN revision 173107
Copyright © 2005-2016 VT MÄK. All Rights Reserved (
www.mak.com
)