WSF
WsfCommTransportLayer.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 WSFCOMMTRANSPORTLAYER_HPP
13#define WSFCOMMTRANSPORTLAYER_HPP
14
15#include "wsf_export.h"
16
17// Base class
18#include "WsfCommLayer.hpp"
19
20namespace wsf
21{
22namespace comm
23{
24
25class Message;
26
28{
29public:
43 enum
44 {
45 cRELIABLE_TRANSPORT = 0x00000001,
46 cORDERED_DELIVERY = 0x00000002,
47 cCHECKSUM = 0x00000004,
48 cMTU = 0x00000008,
49 cFLOW_CONTROL = 0x00000010,
50 cCONGESTION_CONTROL = 0x00000020,
51 cNAGLE_ALGORITHM = 0x00000040
52 };
53
54 // Constructor and destructor
55 TransportLayer() = default;
56 ~TransportLayer() override = default;
57 TransportLayer& operator=(const TransportLayer& aRhs) = delete;
58
60
61 LayerImp* Clone() const override;
62 bool Initialize(double aSimTime) override { return true; }
63 bool ProcessInput(UtInput& aInput) override;
65
67
68 bool Receive(double aSimTime, Comm* aXmtrPtr, Message& aMessage, bool& aNotifyNextLayer) override;
69 bool Send(double aSimTime, size_t aLayerIndex, Message& aMessage, bool& aNotifyNextLayer) override;
71
73
74 bool ProcessLayerMessage(double aSimTime, layer::Message aLayerMessage, Message* aCommMessagePtr) override;
76
78 unsigned int GetTransportFeatures() const { return mTransportFeature; }
79
80protected:
81 // Copy constructor
82 TransportLayer(const TransportLayer& aSrc) = default;
83
84private:
85 unsigned int mTransportFeature{0};
86 unsigned int mMTU{0};
87 unsigned int mChecksum{0};
88
90};
91
92} // namespace comm
93} // namespace wsf
94
95#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
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 WsfCommTransportLayer.cpp:27
unsigned int GetTransportFeatures() const
Returns the mask variable regarding which features the transport layer supports.
Definition WsfCommTransportLayer.hpp:78
bool Initialize(double aSimTime) override
Definition WsfCommTransportLayer.hpp:62
TransportLayer & operator=(const TransportLayer &aRhs)=delete
TransportLayer(const TransportLayer &aSrc)=default
~TransportLayer() override=default
@ cCHECKSUM
Correct ordering, usually via segment numbering.
Definition WsfCommTransportLayer.hpp:47
@ cRELIABLE_TRANSPORT
Definition WsfCommTransportLayer.hpp:45
@ cNAGLE_ALGORITHM
Like flow control, except based on network state (congestion).
Definition WsfCommTransportLayer.hpp:51
@ cORDERED_DELIVERY
ACK/NACK or other confirmation of reception.
Definition WsfCommTransportLayer.hpp:46
@ cFLOW_CONTROL
A maximum transmission unit is defined.
Definition WsfCommTransportLayer.hpp:49
@ cMTU
A checksum value in included, which infers error checking and/or correction.
Definition WsfCommTransportLayer.hpp:48
@ cCONGESTION_CONTROL
Flow control mechanism, to avoid overwhelming a receiver.
Definition WsfCommTransportLayer.hpp:50
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