WSF
NetworkEnabledWeaponPart.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
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#ifndef L16_NETWORKENABLEDWEAPONPART_HPP
12#define L16_NETWORKENABLEDWEAPONPART_HPP
13
14#include "wsf_l16_export.h"
15
16#include "ComputerPart.hpp"
17#include "InputEnumeration.hpp"
18#include "UtCallback.hpp"
19class UtScript;
20class WsfScenario;
21
22namespace WsfL16
23{
24class WSF_L16_EXPORT NetworkEnabledWeaponPart : public ComputerPart
25{
26public:
29
31
32 ComputerPart* Clone() const override;
33
34 bool Initialize(double aSimTime, ComputerProcessor& aComputer) override;
35 bool ProcessInput(UtInput& aInput) override;
37 void HandleReceive(double aSimTime, const Messages::InitialBase& aMessage) override;
39 void HandleSend(double aSimTime) override;
40
41 bool IsNetworkEnabled() override { return mNetworkEnabled; }
42
43private:
44 bool DecodeLabel(const std::string& aLabelStr, int& aLabel, int& aSubLabel);
45
46 typedef std::pair<int, int> MessageLabel;
47
48 UtScript* mOnSendScript;
49
50 std::map<MessageLabel, UtScript*> mReceiveScripts;
51
52 bool mNetworkEnabled;
53};
54} // namespace WsfL16
55
56#endif
ComputerPart(WsfScenario &aScenario, const std::string &aClassName="WsfProcessor")
Definition ComputerPart.cpp:41
Sends and receives link16 messages.
Definition ComputerProcessor.hpp:50
NetworkEnabledWeaponPart(WsfScenario &aScenario)
Definition NetworkEnabledWeaponPart.cpp:42
bool ProcessInput(UtInput &aInput) override
Definition NetworkEnabledWeaponPart.cpp:115
void HandleSend(double aSimTime) override
This method is called when the a slot is open.
Definition NetworkEnabledWeaponPart.cpp:146
ComputerPart * Clone() const override
Definition NetworkEnabledWeaponPart.cpp:58
bool Initialize(double aSimTime, ComputerProcessor &aComputer) override
Definition NetworkEnabledWeaponPart.cpp:63
bool IsNetworkEnabled() override
Definition NetworkEnabledWeaponPart.hpp:41
void HandleReceive(double aSimTime, const Messages::InitialBase &aMessage) override
Handle an incoming message.
Definition NetworkEnabledWeaponPart.cpp:128
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
This file should be included prior to defining a message. Currently there is a limit of 32 fields per...
Definition AllMessages.hpp:55
Copyrights Multiple, All Rights Reserved