VR-Link API Documentation for HLA 1.3
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
include
vl
hServReqInter.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
*********************************************************************/
5
6
7
#ifndef hServReqInter_H_
8
#define hServReqInter_H_
9
10
#if DtHLA
11
12
#include "
hIntWEncDec.h
"
13
#include "
hostStructs.h
"
14
#include <
matrix/vlMath.h
>
15
16
17
#include "
packets/logisticsP.h
"
18
22
23
#define DtSUPPLY_VALID 1
24
#define DtSUPPLY_BAD_INDEX 0
25
26
class
DT_DLL_VL
DtServiceRequestInteraction
;
27
class
DT_DLL_VL
DtExerciseConn
;
28
29
30
32
typedef
void (*
DtServiceRequestInteractionCb
)
33
(
DtServiceRequestInteraction
* inter,
void
* usr);
34
39
40
class
DT_DLL_VL
DtServiceRequestInteraction
:
public
DtInteractionWithEncDec
41
{
42
public
:
43
45
DtServiceRequestInteraction
();
46
48
virtual
~
DtServiceRequestInteraction
();
49
51
DtServiceRequestInteraction
(
const
DtServiceRequestInteraction
& orig);
52
54
DtServiceRequestInteraction
&
operator=
(
55
const
DtServiceRequestInteraction
& orig);
56
58
virtual
void
printData
()
const
;
59
61
virtual
void
printDataToStream
(std::ostream& stream)
const
;
62
64
virtual
void
setRequestingId(
const
DtGlobalObjectDesignator
&requester);
65
virtual
const
DtGlobalObjectDesignator
&requestingId()
const
;
66
68
virtual
void
setServicingId(
const
DtGlobalObjectDesignator
&servicer);
69
virtual
const
DtGlobalObjectDesignator
&servicingId()
const
;
70
72
virtual
void
setServiceType(
DtServiceType
type);
73
virtual
DtServiceType
serviceType()
const
;
74
76
virtual
void
setSupplies(
const
void
* data,
int
numBytes);
77
virtual
const
void
* supplies()
const
;
78
80
virtual
void
setNumSupplyTypes(
int
numTypes);
81
virtual
int
numSupplyTypes()
const
;
82
83
virtual
void
setNthSupply(
int
supplyIndex,
const
DtEntityType
&supply,
84
float
quantity,
int
*retCode = NULL);
85
virtual
const
DtEntityType
& nthSupply(
int
supplyIndex,
86
float
*quantity = NULL,
int
*retCode = NULL)
const
;
87
88
virtual
float
supplyQuantity(
const
DtEntityType
&supply)
const
;
89
90
virtual
void
changeSuppliesSize(
int
newSize);
91
92
virtual
int
indexInBounds(
int
ind)
const
;
93
94
95
97
virtual
const
char
*
name
()
const
;
98
99
public
:
100
103
static
DtInteraction
* create();
104
107
static
void
addCallback
(
DtExerciseConn
* conn,
108
DtServiceRequestInteractionCb
cb,
void
* usr,
109
DtDDMRegionSP
region =
DtDDMRegionSP
());
110
static
void
removeCallback
(
DtExerciseConn
* conn,
111
DtServiceRequestInteractionCb
cb,
void
* usr,
112
DtDDMRegionSP
region =
DtDDMRegionSP
());
113
114
protected
:
115
116
DtGlobalObjectDesignator
myRequestingObject
;
117
DtGlobalObjectDesignator
myServicingObject
;
118
DtServiceType
myServiceType
;
119
int
myNumSupplyTypes
;
120
DtNetSupplyQuantity
*
mySupplies
;
121
DtEntityType
myNthSupply
;
122
};
123
124
inline
const
DtGlobalObjectDesignator
&
DtServiceRequestInteraction::
125
requestingId
()
const
126
{
127
return
myRequestingObject
;
128
}
129
130
inline
const
DtGlobalObjectDesignator
&
DtServiceRequestInteraction::
131
servicingId
()
const
132
{
133
return
myServicingObject
;
134
}
135
136
inline
DtServiceType
DtServiceRequestInteraction::serviceType
()
const
137
{
138
return
myServiceType
;
139
}
140
141
inline
void
DtServiceRequestInteraction::setServicingId
(
142
const
DtGlobalObjectDesignator
&
id
)
143
{
144
myServicingObject
= id;
145
}
146
147
inline
void
DtServiceRequestInteraction::setRequestingId
(
148
const
DtGlobalObjectDesignator
&
id
)
149
{
150
myRequestingObject
= id;
151
}
152
153
inline
void
DtServiceRequestInteraction::setServiceType
(
DtServiceType
type)
154
{
155
myServiceType
= type;
156
}
157
158
inline
const
char
*
DtServiceRequestInteraction::name
()
const
159
{
160
return
"DtServiceRequestInteraction"
;
161
}
162
163
#endif
164
#endif
165
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
)