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