WSF
WsfTrackMessage.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#ifndef WSFTRACKMESSAGE_HPP
13#define WSFTRACKMESSAGE_HPP
14
15#include "wsf_export.h"
16
17#include <memory>
18
19class UtScriptClass;
20class UtScriptTypes;
21#include "WsfMessage.hpp"
22#include "WsfStringId.hpp"
23class WsfTrack;
24
28{
29public:
30 WsfTrackMessage(); // For XIO (de)serialization.
31 WsfTrackMessage(WsfPlatform* aPlatformPtr);
32 WsfTrackMessage(WsfPlatform* aPlatformPtr, const WsfTrack& aTrack);
35 ~WsfTrackMessage() override;
36
39 WsfMessage* Clone() const override { return new WsfTrackMessage(*this); }
40
41 const char* GetScriptClassName() const override;
42
43 static std::unique_ptr<UtScriptClass> CreateScriptClass(const std::string& aClassName, UtScriptTypes* aScriptTypesPtr);
44
45 static WsfStringId GetTypeId();
46
51 WsfTrack* GetTrack() const { return mTrackPtr; }
52
53 void SetTrack(const WsfTrack& aTrack);
54
57
58 WsfStringId GetSenderId() const { return mSenderId; }
59 WsfStringId GetReplyId() const { return mReplyId; }
60 void SetSenderId(WsfStringId aSenderId) { mSenderId = aSenderId; }
61 void SetReplyId(WsfStringId aReplyId) { mReplyId = aReplyId; }
63
64 bool CanBeReplacedBy(const WsfMessage& aMessage) const override;
65
67 WsfStringId GetComponentNameId() const override;
69 WsfStringId GetComponentTypeId() const override;
71 WsfStringId GetComponentModeId() const override;
72
74 template<typename T>
75 void Serialize(T& aBuff)
76 {
78 aBuff& mTrackPtr& mSenderId& mReplyId;
79 }
80
81private:
82 WsfTrack* mTrackPtr;
83
85 WsfStringId mSenderId;
86
88 WsfStringId mReplyId;
89};
90
91#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
virtual WsfStringId GetComponentModeId() const
Definition WsfMessage.hpp:180
WsfMessage(WsfStringId aType)
Constructor for XIO (de)serialization.
Definition WsfMessage.cpp:25
void Serialize(T &aBuff)
(De)serializer for XIO
Definition WsfMessage.hpp:207
const char * GetScriptClassName() const override
Definition WsfMessage.cpp:235
static WsfStringId GetTypeId()
Definition WsfMessage.cpp:159
virtual bool CanBeReplacedBy(const WsfMessage &aMessage) const
Definition WsfMessage.cpp:187
virtual WsfStringId GetComponentNameId() const
Definition WsfMessage.hpp:176
virtual WsfStringId GetComponentTypeId() const
Definition WsfMessage.hpp:178
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
void Serialize(T &aBuff)
For XIO (de)serialization.
Definition WsfTrackMessage.hpp:75
WsfTrackMessage()
Constructor, for XIO (de)serialization.
Definition WsfTrackMessage.cpp:24
void SetSenderId(WsfStringId aSenderId)
Definition WsfTrackMessage.hpp:60
WsfTrackMessage & operator=(const WsfTrackMessage &)=delete
WsfTrack * GetTrack() const
Definition WsfTrackMessage.hpp:51
WsfStringId GetReplyId() const
Definition WsfTrackMessage.hpp:59
WsfMessage * Clone() const override
Definition WsfTrackMessage.hpp:39
WsfStringId GetSenderId() const
Definition WsfTrackMessage.hpp:58
void SetReplyId(WsfStringId aReplyId)
Definition WsfTrackMessage.hpp:61
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Copyrights Multiple, All Rights Reserved