|
WSF
|
#include <WsfCommProtocolMulticast.hpp>


Classes | |
| struct | RouteData |
| A simple data structure to hold routing data. More... | |
Public Member Functions | |
| ProtocolMulticast ()=default | |
| ~ProtocolMulticast () override=default | |
| Public Member Functions inherited from wsf::comm::router::ProtocolInterface | |
| ProtocolInterface ()=default | |
| ~ProtocolInterface () override=default | |
| const char * | GetScriptClassName () const override |
| WsfStringId | GetComponentName () const override final |
| bool | ProcessInput (UtInput &aInput) override |
| bool | operator< (const ProtocolInterface &aRhs) const |
| virtual void | PerfectCommAdded (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectCommRemoved (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectNetworkAdded (double aSimTime, Network *aNetworkPtr) |
| virtual void | PerfectNetworkRemoved (double aSimTime, Network *aNetworkPtr) |
| virtual void | PerfectCommEnabled (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectCommDisabled (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectConnectionAdded (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| virtual void | PerfectConnectionRemoved (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| virtual void | PerfectConnectionEnabled (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| virtual void | PerfectConnectionDisabled (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| Public Member Functions inherited from wsf::comm::router::RouterComponent | |
| RouterComponent ()=default | |
| ~RouterComponent () override=default | |
| Router * | GetRouter () const |
| WsfSimulation * | GetSimulation () const |
| NetworkManager * | GetNetworkManager () const |
| virtual void | PendingStart () |
| virtual bool | Initialize (double aSimTime) |
| virtual bool | Initialize2 (double aSimTime) |
| virtual bool | PreInitialize (double aSimTime) |
| virtual bool | ProcessInput (UtInput &aInput) |
| Public Member Functions inherited from WsfComponentT< Router > | |
| 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) |
Static Public Member Functions | |
| static ProtocolMulticast * | Find (const Router &aParent) |
| static ProtocolMulticast * | FindOrCreate (Router &aParent) |
Graph methods | |
| bool | ShouldPropagateTruth () const override |
| graph::Graph * | GetGraph () const override |
| bool | Send (double aSimTime, Router::SendData &aData) override |
| bool | Receive (double aSimTime, const Address &aReceivingInterface, Message &aMessage, bool &aOverrideForward) override |
| bool | Initialize (double aSimTime) override |
| virtual bool | ForwardMessage (double aSimTime, const Address &aReceivingInterface, Message &aMessage) |
Required ProtocolInterface interface. | |
| WsfComponent * | CloneComponent () const override |
| const int * | GetComponentRoles () const override |
| void * | QueryInterface (int aRole) override |
| int | GetPriority () const override |
| ProtocolMulticast * | Clone () const override |
| std::vector< Address > | Routing (double aSimTime, const Address &aSendingInterface, size_t &aHopNumber, double &aCost, const Message &aMessage) override |
| const char * | GetScriptClassName () const override |
| void | Setup () override |
Additional Inherited Members | |
| Public Types inherited from WsfComponentT< Router > | |
| typedef Router | 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. | |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
This protocol provides a generic multicasting routing capability in AFSIM. It is based on perfect knowledge, and is only intended to provide emulated multicast routing behavior such that forwarded multicast messages are only duplicated and propagated when necessary to deliver to recipients along unique paths.
This routing protocol does not provide the functionality to join or leave multicast groups, nor does it maintain any particular network knowledge. This protocol is intended to be provided by default as a baseline multicasting routing protocol in the absence of, or need for, higher fidelity multicast capabilities.
|
default |
Referenced by Clone(), CloneComponent(), Find(), FindOrCreate(), and ~ProtocolMulticast().
|
overridedefault |
References Clone(), CloneComponent(), GetComponentRoles(), GetPriority(), ProtocolMulticast(), QueryInterface(), and Routing().
|
overridevirtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements wsf::comm::router::ProtocolInterface.
References ProtocolMulticast().
Referenced by ~ProtocolMulticast().
|
overridevirtual |
Clones a component. May return null if component does not support clone.
Implements wsf::comm::router::ProtocolInterface.
References ProtocolMulticast().
Referenced by ~ProtocolMulticast().
|
static |
References WsfComponentList::GetComponent(), wsf::comm::router::Router::GetComponents(), and ProtocolMulticast().
Referenced by FindOrCreate().
|
static |
|
protectedvirtual |
A convenience method for message processing. This method indicates whether a message received on a particular interface will need forwarding to other interfaces.
References WsfAuxDataEnabled::GetAuxData(), wsf::comm::Message::GetTraceRoute(), Routing(), and wsf::comm::Message::SourceMessage().
Referenced by Receive().
|
overridevirtual |
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 wsf::comm::router::ProtocolInterface.
References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_MULTICAST, and cWSF_COMPONENT_NULL.
Referenced by ~ProtocolMulticast().
|
inlineoverridevirtual |
Implements wsf::comm::router::ProtocolInterface.
Referenced by Initialize().
|
overridevirtual |
Required query for protocol priority. Protocols are evaluated in order based on their assigned priorities. A lower value indicates a higher priority.
Implements wsf::comm::router::ProtocolInterface.
References wsf::comm::cMULTICAST.
Referenced by ~ProtocolMulticast().
|
inlineoverride |
|
overridevirtual |
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. |
Set the graph now, if not already set.
Reimplemented from wsf::comm::router::ProtocolInterface.
References WsfSimulation::GetCommNetworkManager(), wsf::comm::NetworkManager::GetGraph(), GetGraph(), and wsf::comm::router::RouterComponent::GetSimulation().
Referenced by wsf::comm::router::ProtocolOSPF::Initialize().
|
overridevirtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Implements wsf::comm::router::ProtocolInterface.
References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_MULTICAST, and wsf::comm::router::ProtocolInterface::ProtocolInterface().
Referenced by ~ProtocolMulticast().
|
overridevirtual |
Reimplemented from wsf::comm::router::ProtocolInterface.
References wsf::comm::Address::CheckInAddressRange(), wsf::comm::Comm::cLEVEL_2, wsf::comm::router::cMulticastRange, ForwardMessage(), wsf::comm::NetworkManager::GetComm(), wsf::comm::router::Router::GetNetworkManager(), wsf::comm::router::RouterComponent::GetRouter(), and wsf::comm::Message::SourceMessage().
|
overridevirtual |
The routing method is used by the router to determine the route based on the protocol defined routing algorithm. A return of an empty vector indicates that no path was found. The router will utilize any of its available interfaces to find a valid path.
TODO - ALLOW PASSAGE OF A ROUTING ALGORITHM FOR USER SPECIFICATION
We have to check for path sizes of 1 here, which indicate a destination of self. The protocol pushes received multicast messages here, and this comm/router/protocol may be one of the recipients. In such a case, we ignore it, since it has already been received.
Implements wsf::comm::router::ProtocolInterface.
References wsf::comm::router::RouterComponent::GetRouter(), and wsf::comm::Message::SourceMessage().
Referenced by ForwardMessage(), Send(), and ~ProtocolMulticast().
|
overridevirtual |
If conformance level is above 0, we can send a message using the interface.
Remove any references to the sender - the sender won't send to self
Now we have all the possible paths to members. For each unique next hop, we have send a message. However, we also have to look and the traceroute to ensure we're not going back to a node we've already visited. This will ensure the correct number of messages are cloned and sent, and at the appropriate routers.
This next hop has not been traversed. Add it to our set.
Insert the set of intended destinations to each unique path.
Reimplemented from wsf::comm::router::ProtocolInterface.
References wsf::comm::Address::CheckInAddressRange(), wsf::comm::Comm::cLEVEL_0, wsf::comm::router::cMulticastRange, wsf::comm::Comm::GetAddress(), WsfAuxDataEnabled::GetAuxData(), WsfSimulation::GetCommNetworkManager(), wsf::comm::router::Router::SendData::GetMessages(), wsf::comm::Comm::GetMulticastLevel(), wsf::comm::router::RouterComponent::GetRouter(), WsfPlatformPart::GetSimulation(), wsf::comm::router::Router::SendData::GetXmtr(), wsf::comm::router::ProtocolMulticast::RouteData::mCost, wsf::comm::router::ProtocolMulticast::RouteData::mFullPath, wsf::comm::router::ProtocolMulticast::RouteData::mHops, wsf::comm::router::ProtocolMulticast::RouteData::mNextHop, Routing(), wsf::comm::router::Router::SendData::SetAbortProcessing(), wsf::comm::Message::SourceMessage(), and success.
|
overridevirtual |
Reimplemented from wsf::comm::router::RouterComponent.
References WsfSimulation::GetCommNetworkManager(), wsf::comm::NetworkManager::GetGraph(), and wsf::comm::router::RouterComponent::GetSimulation().
|
inlineoverridevirtual |
Implements wsf::comm::router::ProtocolInterface.