WSF
WsfDisPlaybackDevice.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11// ****************************************************************************
12// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFDISPLAYBACKDEVICE_HPP
16#define WSFDISPLAYBACKDEVICE_HPP
17
18#include "wsf_export.h"
19
20#include <set>
21#include <string>
22
23#include "DisEntityId.hpp"
24class DisEntityState;
25class DisPdu;
26class DisPduFactory;
27class GenFileI;
28#include "WsfDisDevice.hpp"
29class WsfDisInterface;
30class WsfPlatform;
31
44{
45public:
46 static DisUint16 cMIN_PLAYBACK_SITE;
47 static DisUint16 cMAX_PLAYBACK_SITE;
48
49 WsfDisPlaybackDevice(const std::string& aFileName, WsfDisInterface* aInterfacePtr);
50
51 ~WsfDisPlaybackDevice() override;
52
53 DisPdu* GetPdu(DisPduFactory* aPduFactoryPtr) override;
54
55 // Provide required implementation of abstract base class method.
56 // This is not an output device, so it doesn't do anything.
57 void PutPduP(double aSimTime, DisPdu& aPdu) override {}
58
59 static void EntityDeleted(const DisEntityId& aEntityId);
60
62 static bool IsPlaybackEntity(const DisEntityId& aEntityId)
63 {
64 DisUint16 site = aEntityId.GetSite();
65 return ((site >= cMIN_PLAYBACK_SITE) && (site <= cMAX_PLAYBACK_SITE));
66 }
67
68 static void PreparePlaybackPlatform(double aSimTime, WsfPlatform* aPlatformPtr, DisEntityState* aEntityPtr);
69 static void Reset();
70
71private:
72 void ReadNextPdu(DisPduFactory* aPduFactoryPtr);
73
74 std::string mFileName;
75 GenFileI* mFilePtr;
76 bool mIsCME_File;
77 bool mEOF;
78
80 DisUint16 mSiteNumber;
81 DisPdu* mNextPduPtr;
82 double mNextPduTime;
83
84 static DisUint16 sNextSiteNumber;
85
86 static std::set<DisEntityId> sDeletedEntities;
87};
88
89#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfDisDevice(WsfDisInterface *aInterfacePtr)
Definition WsfDisDevice.cpp:20
virtual DisPdu * GetPdu(DisPduFactory *aPduFactoryPtr)
Definition WsfDisDevice.cpp:29
Definition WsfDisInterface.hpp:83
static DisUint16 cMIN_PLAYBACK_SITE
Definition WsfDisPlaybackDevice.hpp:46
static bool IsPlaybackEntity(const DisEntityId &aEntityId)
the supplied entity ID associated with a playback entity.
Definition WsfDisPlaybackDevice.hpp:62
static DisUint16 cMAX_PLAYBACK_SITE
Definition WsfDisPlaybackDevice.hpp:47
WsfDisPlaybackDevice(const std::string &aFileName, WsfDisInterface *aInterfacePtr)
Definition WsfDisPlaybackDevice.cpp:43
void PutPduP(double aSimTime, DisPdu &aPdu) override
Definition WsfDisPlaybackDevice.hpp:57
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Copyrights Multiple, All Rights Reserved