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
arealObjectPublisherDIS.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (c) 2014 VT MAK
3
* All rights reserved.
4
****************************************************************************/
5
9
10
#pragma once
11
12
#if DtDIS
13
14
#include <
vl/pdu.h
>
15
#include <
vl/objectPublisherDIS.h
>
16
#include <
vl/arealObjectRepository.h
>
17
#include <
vl/arealObjectDecoderDIS.h
>
18
#include <
vl/arealObjectEncoderDIS.h
>
19
#include <
vlutil/vlPrint.h
>
20
21
class
DT_DLL_VL
DtArealObjectPublisher
:
public
DtObjectPublisher
22
{
23
public
:
24
26
typedef
DtArealObjectRepository
* (*DtStateRepCreator)();
27
28
public
:
29
31
DtArealObjectPublisher
(
DtExerciseConn
* conn,
32
const
DtObjectId
&
id
=
DtObjectId::defaultId
() );
33
35
DtArealObjectPublisher
(
DtArealObjectRepository
* stateRepToUse,
36
DtExerciseConn
* conn,
const
DtObjectId
&
id
=
DtObjectId::defaultId
() );
37
39
DtArealObjectPublisher
(
const
DtSyntheticEnvironmentObjectType
& type,
40
DtExerciseConn
* conn,
const
DtObjectId
&
id
=
DtObjectId::defaultId
() );
41
43
virtual
~
DtArealObjectPublisher
();
44
48
virtual
void
tick
();
49
52
virtual
inline
DtArealObjectRepository
* arealObjectStateRep();
53
55
virtual
inline
DtArealObjectRepository
* aosr();
56
59
virtual
inline
DtArealObjectDecoder
*
decoder
() {
return
myDecoder; }
60
63
virtual
inline
DtArealObjectEncoder
*
encoder
() {
return
myEncoder; }
64
66
virtual
const
DtObjectId
&
id
()
const
;
67
69
virtual
inline
const
DtObjectId
&
localId
()
const
{
return
id
(); }
70
72
virtual
inline
const
DtGlobalObjectDesignator
&
globalId
()
const
{
return
id
(); }
73
76
virtual
inline
void
sendFinalPduOnDestruction(
bool
onOff );
77
80
virtual
inline
void
forceUpdate
();
81
83
virtual
void
setLocThreshold(
double
val );
84
virtual
double
locThreshold()
const
;
85
87
static
inline
void
setDfltLocThreshold(
double
val );
88
static
inline
double
dfltLocThreshold();
89
91
static
void
setStateRepCreator( DtStateRepCreator creator );
92
static
DtStateRepCreator stateRepCreator();
93
94
static
void
setClassDfltTimeThreshold(
DtTime
threshold );
95
96
protected
:
97
99
void
init(
const
DtObjectId
& );
100
102
void
sendFinalPdu();
103
104
private
:
105
107
DtArealObjectPublisher
(
const
DtArealObjectPublisher
& );
108
110
DtArealObjectPublisher
&
operator =
(
const
DtArealObjectPublisher
& );
111
112
protected
:
113
114
static
DtStateRepCreator
theStateRepCreator
;
115
116
static
double
theDfltLocThreshold
;
117
static
DtTime
theClassDfltTimeThreshold
;
118
static
bool
theClassDfltIsSetFlag
;
119
120
DtArealObjectDecoder
*
myDecoder
;
121
DtArealObjectEncoder
*
myEncoder
;
122
bool
myStateRepPassedFlag
;
123
bool
mySendFinalInDtor
;
124
125
};
126
127
inline
DtArealObjectRepository
*
DtArealObjectPublisher::arealObjectStateRep
()
128
{
129
return
aosr
();
130
}
131
132
inline
DtArealObjectRepository
*
DtArealObjectPublisher::aosr
()
133
{
134
return
static_cast<
DtArealObjectRepository
*
>
(
myStateRep
);
135
}
136
137
inline
void
DtArealObjectPublisher::forceUpdate
()
138
{
139
myEncoder
->
setSendNeeded
();
140
}
141
142
inline
void
DtArealObjectPublisher::sendFinalPduOnDestruction
(
bool
onOff )
143
{
144
mySendFinalInDtor
= onOff;
145
}
146
147
inline
void
DtArealObjectPublisher::setDfltLocThreshold
(
double
val )
148
{
149
theDfltLocThreshold
= val;
150
}
151
152
inline
double
DtArealObjectPublisher::dfltLocThreshold
()
153
{
154
return
theDfltLocThreshold
;
155
}
156
157
#endif // DtDIS
Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (
www.mak.com
)