VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrfmsgs
ifSnapshotsResponse.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2016 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
8
9
#pragma once
10
11
#include "
vrfmsgs/vrfmsgsDefines.h
"
12
#include "
vrfmsgs/ifStatus.h
"
13
#include <vlutil/vlString.h>
14
#include <
vrfExtProtocol/simInterfaceContent.h
>
15
16
24
25
class
DT_DLL_vrfmsgs
DtIfSnapshotsResponse
:
public
DtSimInterfaceContent
26
{
27
public
:
28
29
struct
Snapshot
30
{
31
Snapshot
() : simTime(0), isPeriodic(false), SnapshotId(-1) {};
32
Snapshot
(
const
Snapshot
& orig)
33
: simTime(orig.simTime), SnapshotId(orig.SnapshotId),
34
isPeriodic(orig.isPeriodic) {};
35
36
virtual
~Snapshot
() {};
37
38
bool
operator==
(
const
Snapshot
& rhs)
const
39
{
40
return
((simTime == rhs.
simTime
) &&
41
(SnapshotId == rhs.
SnapshotId
) &&
42
(isPeriodic == rhs.
isPeriodic
));
43
}
44
45
bool
operator!=
(
const
Snapshot
& rhs)
const
{
return
!(*
this
== rhs); }
46
47
double
simTime
;
48
bool
isPeriodic
;
49
int
SnapshotId
;
50
};
51
52
typedef
std::map<int, Snapshot>
SnapshotStatus
;
53
54
public
:
55
57
DtIfSnapshotsResponse
();
58
60
virtual
~
DtIfSnapshotsResponse
();
61
63
DtIfSnapshotsResponse
(
const
DtIfSnapshotsResponse
& orig);
64
66
DtIfSnapshotsResponse
&
operator=
(
const
DtIfSnapshotsResponse
& orig);
67
69
virtual
int
type
()
const
;
70
71
virtual
DtSimInterfaceContent
*
clone
()
const
;
72
73
virtual
int
netRepSize
()
const
;
74
virtual
bool
setFromNet
(
const
char
* contentBuffer,
75
unsigned
contentSize);
76
virtual
bool
setToNet
();
77
78
virtual
void
printDataToString
(
DtString
& str);
79
80
static
DtSimInterfaceContent
* creator();
81
84
virtual
const
SnapshotStatus
& snapshots()
const
;
85
virtual
void
addSnapshot(
int
id
,
double
simTime,
bool
isPeriodic);
86
virtual
void
setSnapshots(
const
SnapshotStatus
&);
87
virtual
void
removeSnapshot(
int
id
);
88
virtual
void
removeAllBut(
int
id
);
89
virtual
void
clear();
91
92
virtual
void
setBaseSnapshotTime(
double
);
93
double
baseSnapshotTime()
const
{
return
myBaseSnapshotTime; };
94
95
protected
:
96
SnapshotStatus mySnapshots;
97
double
myBaseSnapshotTime
;
98
};
99
100
namespace
DtBufferSerialize
101
{
103
DT_DLL_vrfmsgs
int
getSize
(
const
DtIfSnapshotsResponse::Snapshot
& messagePtr);
104
108
DT_DLL_vrfmsgs
char
*
encode
(
const
DtIfSnapshotsResponse::Snapshot
& messagePtr,
char
*buffer);
109
113
DT_DLL_vrfmsgs
const
char
*
decode
(
DtIfSnapshotsResponse::Snapshot
& messagePtr,
const
char
*buffer);
114
}
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)