VR-Link API Documentation for DIS
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
include
vl
serviceRequestPdu.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2013 VT MAK
3
** All rights reserved.
4
*********************************************************************/
5
6
7
#if DtDIS
8
11
12
#pragma once
13
14
#include "
pdu.h
"
15
#include "
packets/logisticsP.h
"
16
#include "
hostStructs.h
"
17
#include "
interactionDIS.h
"
18
19
#define DtSUPPLY_VALID 1
20
#define DtSUPPLY_BAD_INDEX 0
21
22
class
DT_DLL_VL
DtExerciseConn
;
23
24
class
DT_DLL_VL
DtServiceRequestPdu
;
25
typedef
DtServiceRequestPdu
DtServiceRequestInteraction
;
26
typedef
void (*
DtServiceRequestPduCb
)(
DtServiceRequestPdu
*pdu,
void
*usr);
27
28
class
DT_DLL_VL
DtServiceRequestPdu
:
public
DtInteraction
29
{
30
31
public
:
32
33
enum
{ PduStaticSize=28 };
34
35
public
:
36
37
38
DtServiceRequestPdu
(
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
);
39
DtServiceRequestPdu
(
const
DtNetServiceRequestPdu
*initial,
40
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
41
42
DtServiceRequestPdu
(
const
DtEntityIdentifier
&requester,
43
const
DtEntityIdentifier
&servicer,
44
DtServiceType
serviceType =
DtServiceTypeRepair
,
45
DtBufferPtr
another =
DtUSE_INTERNAL_BUFFER
);
46
47
48
DtServiceRequestPdu
(
const
DtEntityIdentifier
&requester,
49
const
DtEntityIdentifier
&servicer,
50
const
DtEntityType
&supply,
51
float
quantity,
52
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
);
53
54
55
const
DtEntityIdentifier
&requestingId()
const
;
56
void
setRequestingId(
const
DtEntityIdentifier
&requester);
57
58
const
DtEntityIdentifier
&servicingId()
const
;
59
void
setServicingId(
const
DtEntityIdentifier
&servicer);
60
61
DtServiceType
serviceType()
const
;
62
void
setServiceType(
DtServiceType
service);
63
64
int
numSupplyTypes()
const
;
65
void
setNumSupplyTypes(
int
numTypes);
66
67
const
DtEntityType
&nthSupply(
int
supplyIndex,
68
float
*quantity = NULL,
69
int
*retCode = NULL)
const
;
70
void
setNthSupply(
int
supplyIndex,
71
const
DtEntityType
&supply,
72
float
quantity,
73
int
*retCode = NULL);
74
75
float
supplyQuantity(
const
DtEntityType
&supply)
const
;
76
77
virtual
void
printData
()
const
;
78
virtual
void
printDataToStream
(std::ostream& stream)
const
;
79
80
public
:
81
82
static
DtPdu
*create(
const
DtNetPacket
*initial,
83
DtBufferPtr
buffer =
DtUSE_INTERNAL_BUFFER
,
DtPduFactory
* pduFactory = 0);
84
static
void
addCallback(
DtExerciseConn
*conn,
85
DtServiceRequestPduCb
cb,
void
*usr);
86
static
void
removeCallback(
DtExerciseConn
*conn,
87
DtServiceRequestPduCb
cb,
void
*usr);
88
protected
:
89
DtPduKind
internalGetPduKind
()
const
{
return
DtServiceRequestPduKind
;}
90
int
indexInBounds(
int
ind)
const
;
91
DtEntityIdentifier
reqId
;
92
DtEntityIdentifier
servId
;
93
DtEntityType
supType
;
94
};
95
96
#endif
Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)