WSF
WsfCommComponent.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 WSFCOMMCOMPONENT_HPP
13#define WSFCOMMCOMPONENT_HPP
14
15#include "wsf_export.h"
16
17#include "WsfComponent.hpp"
18
19class WsfMessage;
20class WsfPlatform;
21class WsfSimulation;
22
23namespace wsf
24{
25namespace comm
26{
27
28class Address;
29class Comm;
30class Message;
31class Result;
32
41{
42public:
43 Component() = default;
44 ~Component() override = default;
45
47
48 Comm* GetComm() const { return GetComponentParent(); }
49 WsfPlatform* GetPlatform() const;
50 WsfSimulation* GetSimulation() const;
52
60
65 virtual void TurnOn(double aSimTime) {}
66 virtual void TurnOff(double aSimTime) {}
67 virtual void Setup() {}
68 virtual void PendingStart() {}
70
76
77
78 virtual void AttemptToTransmit(double aSimTime, Result& aResult) {}
79
80 virtual void AttemptToReceive(double aSimTime, Result& aResult) {}
81
82 virtual bool CanInteractWith(const Comm* aXmtrPtr);
83
84 virtual bool Receive(double aSimTime, Comm* aXmtrPtr, Message& aMessage) { return true; }
85 virtual bool Send(double aSimTime, const WsfMessage& aMessage, const Address& aAddress) { return true; }
86
88
92
93 static void AttemptToTransmit(Comm& aComm, double aSimTime, Result& aResult);
94
95 static void AttemptToReceive(Comm& aComm, double aSimTime, Result& aResult);
96
97 static bool Receive(Comm& aComm, double aSimTime, Comm* aXmtrPtr, Message& aMessage);
98 static bool Send(Comm& aComm, double aSimTime, const WsfMessage& aMessage, const Address& aAddress);
100};
101
102} // namespace comm
103} // namespace wsf
104
105#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfComponentT()
Definition WsfComponent.hpp:124
ParentType * GetComponentParent() const
Definition WsfComponent.hpp:154
virtual bool Initialize(double aSimTime)
Definition WsfComponent.cpp:45
virtual bool PreInitialize(double aSimTime)
Definition WsfComponent.cpp:24
virtual bool Initialize2(double aSimTime)
Definition WsfComponent.cpp:63
virtual bool ProcessInput(UtInput &aInput)
Definition WsfComponent.cpp:100
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfCommAddress.hpp:57
Definition WsfComm.hpp:43
~Component() override=default
virtual void TurnOn(double aSimTime)
Definition WsfCommComponent.hpp:65
virtual void Setup()
Definition WsfCommComponent.hpp:67
virtual bool Send(double aSimTime, const WsfMessage &aMessage, const Address &aAddress)
Definition WsfCommComponent.hpp:85
virtual void AttemptToTransmit(double aSimTime, Result &aResult)
Definition WsfCommComponent.hpp:78
virtual void TurnOff(double aSimTime)
Definition WsfCommComponent.hpp:66
virtual void AttemptToReceive(double aSimTime, Result &aResult)
Definition WsfCommComponent.hpp:80
virtual bool Receive(double aSimTime, Comm *aXmtrPtr, Message &aMessage)
Definition WsfCommComponent.hpp:84
Comm * GetComm() const
Definition WsfCommComponent.hpp:48
virtual void PendingStart()
Definition WsfCommComponent.hpp:68
Definition WsfCommMessage.hpp:51
Definition WsfCommResult.hpp:34
Definition WsfComm.cpp:34
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved