|
WSF
|
#include <WsfCommProtocolInterface.hpp>


Public Types | |
| using | ProcessResult = std::pair<bool, bool> |
| Public Types inherited from WsfComponentT< Comm > | |
| typedef Comm | ParentType |
| This is needed to support the WsfComponentList template. | |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
Public Member Functions | |
| ProtocolInterface ()=default | |
| ~ProtocolInterface () override=default | |
| const char * | GetScriptClassName () const override |
| Public Member Functions inherited from wsf::comm::Component | |
| Component ()=default | |
| ~Component () override=default | |
| Comm * | GetComm () const |
| WsfPlatform * | GetPlatform () const |
| WsfSimulation * | GetSimulation () const |
| virtual void | TurnOn (double aSimTime) |
| virtual void | TurnOff (double aSimTime) |
| virtual void | Setup () |
| virtual void | PendingStart () |
| virtual bool | Initialize2 (double aSimTime) |
| virtual bool | PreInitialize (double aSimTime) |
| virtual void | AttemptToTransmit (double aSimTime, Result &aResult) |
| virtual void | AttemptToReceive (double aSimTime, Result &aResult) |
| virtual bool | CanInteractWith (const Comm *aXmtrPtr) |
| virtual bool | Receive (double aSimTime, Comm *aXmtrPtr, Message &aMessage) |
| virtual bool | Send (double aSimTime, const WsfMessage &aMessage, const Address &aAddress) |
| Public Member Functions inherited from WsfComponentT< Comm > | |
| WsfComponentT () | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| virtual void | ComponentParentChanged (ParentType *aParentPtr) |
| ParentType * | GetComponentParent () const |
| void | SetComponentParent (ParentType *aParentPtr) |
| Public Member Functions inherited from WsfComponent | |
| virtual | ~WsfComponent ()=default |
| virtual int | GetComponentInitializationOrder () const |
| template<typename T> | |
| bool | QueryInterfaceT (T *&aRolePtr) |
| bool | ComponentHasRole (int aRole) |
| Returns true if the component has the specified role. | |
| virtual void | PreInput () |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
Required interface from WsfComponent. | |
| WsfComponent * | CloneComponent () const override=0 |
| WsfStringId | GetComponentName () const final |
| const int * | GetComponentRoles () const override=0 |
| void * | QueryInterface (int aRole) override=0 |
Required interface from WsfObject | |
| ProtocolInterface * | Clone () const override=0 |
Interface from WsfCommComponent. | |
| bool | Initialize (double aSimTime) override |
| bool | ProcessInput (UtInput &aInput) override |
Operator Overloads | |
| bool | operator< (const ProtocolInterface &aRhs) const |
| virtual ProtocolPriority | GetPriority () const =0 |
Application Layer Send/Receive | |
| virtual ProcessResult | ApplicationSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | ApplicationReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Presentation Layer Send/Receive | |
| virtual ProcessResult | PresentationSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | PresentationReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Session Layer Send/Receive | |
| virtual ProcessResult | SessionSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | SessionReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Transport Layer Send/Receive | |
| virtual ProcessResult | TransportSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | TransportReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Network Layer Send/Receive | |
| virtual ProcessResult | NetworkSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | NetworkReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Datalink Layer Send/Receive | |
| virtual ProcessResult | DatalinkSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | DatalinkReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Physical Layer Send/Receive | |
| virtual ProcessResult | PhysicalSend (double aSimTime, size_t aLayerIndex, Message &aMessage) |
| virtual ProcessResult | PhysicalReceive (double aSimTime, size_t aLayerIndex, Message &aMessage) |
Additional Inherited Members | |
| static void | AttemptToTransmit (Comm &aComm, double aSimTime, Result &aResult) |
| Called by model implementations when attempting to send a message. | |
| static void | AttemptToReceive (Comm &aComm, double aSimTime, Result &aResult) |
| Called by model implementations when attempting to receive a message. | |
| static bool | Receive (Comm &aComm, double aSimTime, Comm *aXmtrPtr, Message &aMessage) |
| static bool | Send (Comm &aComm, double aSimTime, const WsfMessage &aMessage, const Address &aAddress) |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
The ProtocolInterface class is an interface for any implementation of of protocols for use with comms in AFSIM. Any comm object may use multiple protocols, which are called during typical layer operations. It is the responsibility of the user implementing these protocols to ensure compatibility, especially with the basic protocols pre-defined within the AFSIM comms framework. Protocols are components, which are added directly to comm objects, and are subject to addition, modification, and removal at any time during a simulation.
| using wsf::comm::ProtocolInterface::ProcessResult = std::pair<bool, bool> |
|
default |
Referenced by Clone(), operator<(), and wsf::comm::ProtocolIGMP::QueryInterface().
|
overridedefault |
|
inlinevirtual |
|
inlinevirtual |
|
overridepure virtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements WsfObject.
Implemented in wsf::comm::ProtocolIGMP.
References ProtocolInterface().
|
overridepure virtual |
Clones a component. May return null if component does not support clone.
Implements WsfComponent.
Implemented in wsf::comm::ProtocolIGMP.
|
inlinevirtual |
|
inlinevirtual |
|
inlinefinalvirtual |
Returns the component's name. Each component in a component list has a unique name. Names are usually defined by the user, but they may also be generated by code and prefixed with a '#' to guarantee no collisions with user-defined names.
Implements WsfComponent.
References WsfObject::GetNameId().
|
overridepure virtual |
Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:
Implements WsfComponent.
Implemented in wsf::comm::ProtocolIGMP.
|
pure virtual |
Required query for protocol priority. Protocols are evaluated in order based on their assigned priorities. A lower value indicates a higher priority.
Implemented in wsf::comm::ProtocolIGMP.
Referenced by wsf::comm::Comm::GetSortedProtocols(), and operator<().
|
inlineoverride |
|
inlineoverridevirtual |
Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).
The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.
| aSimTime | The current simulation time. |
Reimplemented from wsf::comm::Component.
|
inlinevirtual |
Reimplemented in wsf::comm::ProtocolIGMP.
|
inlinevirtual |
Reimplemented in wsf::comm::ProtocolIGMP.
|
inline |
References GetPriority(), and ProtocolInterface().
|
inlinevirtual |
Reimplemented in wsf::comm::ProtocolIGMP.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlineoverridevirtual |
Evaluate the current input command and determine if it is one processed by the component. The component should get the current command from the input stream and determine if it is one that it recognizes. If it does not recognize the command then it should leave the command in the input stream and return false. If it does recognize the command then it should process the command and return true. If invalid arguments are encountered then it should throw an exception.
| aInput | The input stream. |
| UtInput::ExceptionBase | if an invalid input was encountered. |
Reimplemented from wsf::comm::Component.
|
overridepure virtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Implements WsfComponent.
Implemented in wsf::comm::ProtocolIGMP.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |