WSF
WsfCommPhysicalLayer.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 2017 Infoscitex, a DCS 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 WSFCOMMPHYSICALLAYER_HPP
13#define WSFCOMMPHYSICALLAYER_HPP
14
15#include "wsf_export.h"
16
17#include "WsfCommLayer.hpp"
18#include "WsfCommResult.hpp"
19#include "WsfRandomVariable.hpp"
20
21namespace wsf
22{
23namespace comm
24{
25
27{
28public:
29 // Constructor and destructor
30 PhysicalLayer() = default;
31 ~PhysicalLayer() override = default;
32
34
35 LayerImp* Clone() const override;
36 bool Initialize(double aSimTime) override { return true; }
37 bool ProcessInput(UtInput& aInput) override;
39
41
42 bool Receive(double aSimTime, Comm* aXmtrPtr, Message& aMessage, bool& aNotifyNextLayer) override;
43 bool Send(double aSimTime, size_t aLayerIndex, Message& aMessage, bool& aNotifyNextLayer) override;
45
47
48 bool ProcessLayerMessage(double aSimTime, layer::Message aLayerMessage, Message* aCommMessagePtr) override;
50
51 virtual double GetTransferRate() const { return mTransferRate.Draw(); }
52
53protected:
54 // Pass-through call for ComponentHW::CanReceiveFrom.
55 // Returns true if the related models indicate that
56 // a message can be received. Returns false otherwise,
57 // or when a hardware component is not being utilized.
58 virtual bool CanReceiveFrom(double aSimTime, Comm& aXmtr, Result& aResult);
59
60 // Copy constructor
61 PhysicalLayer(const PhysicalLayer& aSrc) = default;
62
64 PhysicalLayer& operator=(const PhysicalLayer& aRhs) = delete;
65
72};
73
74} // namespace comm
75} // namespace wsf
76
77#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfRandomVariable.hpp:33
@ cPOSITIVE
Value must be greater than zero.
Definition WsfRandomVariable.hpp:49
Definition WsfComm.hpp:43
A base class defining the interface for the implementation classes. (Implementor).
Definition WsfCommLayer.hpp:127
Definition WsfCommMessage.hpp:51
LayerImp * Clone() const override
Definition WsfCommPhysicalLayer.cpp:37
PhysicalLayer(const PhysicalLayer &aSrc)=default
virtual double GetTransferRate() const
Definition WsfCommPhysicalLayer.hpp:51
PhysicalLayer & operator=(const PhysicalLayer &aRhs)=delete
Prevent use of operator= by declaring, but not defining.
WsfRandomVariable mTransferRate
Definition WsfCommPhysicalLayer.hpp:71
~PhysicalLayer() override=default
bool Initialize(double aSimTime) override
Definition WsfCommPhysicalLayer.hpp:36
Definition WsfCommResult.hpp:34
Definition WsfCommLayerMessage.hpp:36
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