#include <WsfCommRouterProtocolInterface.hpp>
|
If a protocol uses a graph representation, this method should return it for operations. Not all protocols have this functionality, and should return a nullptr on the GetGraph function if that is the case. The ShouldPropagateTruth function provides whether or not the router should push updates from the truth representation (the network manager) to this protocol during updates (otherwise it is up to the protocol or direct user input do accomplish this).
|
| virtual bool | ShouldPropagateTruth () const =0 |
| virtual graph::Graph * | GetGraph () const =0 |
| virtual int | GetPriority () const =0 |
| virtual std::vector< Address > | Routing (double aSimTime, const Address &aSendingInterface, size_t &aHopNumber, double &aCost, const Message &aMessage)=0 |
|
The send and receive methods for the routing protocol provide hooks into querying each protocol for router message processing.
The send method is queried, allowing the protocol to process the the message prior to a transmission. By default, this method returns true with no additional message processing. Returning false indicates an issue with this protocol not being able to process this message transmission, upon which the router will attempt the same process for other available protocols (if applicable). This method also allows the protocol to conduct internal bookkeeping when messages are sent.
The receive method is called when an interface receives a message. If the destination address of the message isn't natively mapped to the receiving interface, a protocol may use a different addressing schema (such as in multicast groups). This method also allows the protocol to conduct internal bookkeeping when messages are received. This method returns true to indicate the message is intended for the current receiving interface, false if not. Any given protocol that returns false will allow other, lower priority protocols, an attempt to process this message after returning false.
|
| virtual bool | Send (double aSimTime, Router::SendData &aData) |
| virtual bool | Receive (double aSimTime, const Address &aReceivingInterface, Message &aMessage, bool &aOverrideForward) |
|
Some protocols may wish to take implementation defined actions based on truth state updates in the simulation via the Network Manager. These methods may be overridden, and are called during the applicable event from the router.
|
| 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) |
◆ ProtocolInterface()
| wsf::comm::router::ProtocolInterface::ProtocolInterface |
( |
| ) |
|
|
default |
◆ ~ProtocolInterface()
| wsf::comm::router::ProtocolInterface::~ProtocolInterface |
( |
| ) |
|
|
overridedefault |
◆ Clone()
◆ CloneComponent()
| WsfComponent * wsf::comm::router::ProtocolInterface::CloneComponent |
( |
| ) |
const |
|
overridepure virtual |
◆ GetComponentName()
| WsfStringId wsf::comm::router::ProtocolInterface::GetComponentName |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
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().
◆ GetComponentRoles()
| const int * wsf::comm::router::ProtocolInterface::GetComponentRoles |
( |
| ) |
const |
|
overridepure virtual |
◆ GetGraph()
| virtual graph::Graph * wsf::comm::router::ProtocolInterface::GetGraph |
( |
| ) |
const |
|
pure virtual |
Implemented in wsf::comm::router::ProtocolAdHoc, wsf::comm::router::ProtocolLegacy, wsf::comm::router::ProtocolMulticast, wsf::comm::router::ProtocolOSPF, and wsf::comm::router::rip::RIPv2.
Referenced by wsf::comm::router::Router::AddLink(), wsf::comm::router::Router::AddNode(), wsf::comm::router::Router::DisableLink(), wsf::comm::router::Router::DisableNode(), wsf::comm::router::Router::EnableLink(), wsf::comm::router::Router::EnableNode(), wsf::comm::router::Router::RemoveLink(), and wsf::comm::router::Router::RemoveNode().
◆ GetPriority()
| virtual int wsf::comm::router::ProtocolInterface::GetPriority |
( |
| ) |
const |
|
pure virtual |
◆ GetScriptClassName()
| const char * wsf::comm::router::ProtocolInterface::GetScriptClassName |
( |
| ) |
const |
|
inlineoverride |
◆ Initialize()
| bool wsf::comm::router::ProtocolInterface::Initialize |
( |
double | aSimTime | ) |
|
|
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.
- Parameters
-
| aSimTime | The current simulation time. |
- Returns
- true if successful or false if unsuccessful (bad input data, etc.)
- Note
- This method should NOT add any other components to the platform. This MUST be done in PreInitialize().
Reimplemented from WsfComponent.
Reimplemented in wsf::comm::router::ProtocolLegacy, wsf::comm::router::ProtocolMulticast, wsf::comm::router::ProtocolOSPF, and wsf::comm::router::rip::RIPv2.
◆ operator<()
| bool wsf::comm::router::ProtocolInterface::operator< |
( |
const ProtocolInterface & | aRhs | ) |
const |
|
inline |
◆ PerfectCommAdded()
| virtual void wsf::comm::router::ProtocolInterface::PerfectCommAdded |
( |
double | aSimTime, |
|
|
Comm * | aCommPtr ) |
|
inlinevirtual |
◆ PerfectCommDisabled()
| virtual void wsf::comm::router::ProtocolInterface::PerfectCommDisabled |
( |
double | aSimTime, |
|
|
Comm * | aCommPtr ) |
|
inlinevirtual |
◆ PerfectCommEnabled()
| virtual void wsf::comm::router::ProtocolInterface::PerfectCommEnabled |
( |
double | aSimTime, |
|
|
Comm * | aCommPtr ) |
|
inlinevirtual |
◆ PerfectCommRemoved()
| virtual void wsf::comm::router::ProtocolInterface::PerfectCommRemoved |
( |
double | aSimTime, |
|
|
Comm * | aCommPtr ) |
|
inlinevirtual |
◆ PerfectConnectionAdded()
| virtual void wsf::comm::router::ProtocolInterface::PerfectConnectionAdded |
( |
double | aSimTime, |
|
|
const Address & | aSourceAddress, |
|
|
const Address & | aDestinationAddress ) |
|
inlinevirtual |
◆ PerfectConnectionDisabled()
| virtual void wsf::comm::router::ProtocolInterface::PerfectConnectionDisabled |
( |
double | aSimTime, |
|
|
const Address & | aSourceAddress, |
|
|
const Address & | aDestinationAddress ) |
|
inlinevirtual |
◆ PerfectConnectionEnabled()
| virtual void wsf::comm::router::ProtocolInterface::PerfectConnectionEnabled |
( |
double | aSimTime, |
|
|
const Address & | aSourceAddress, |
|
|
const Address & | aDestinationAddress ) |
|
inlinevirtual |
◆ PerfectConnectionRemoved()
| virtual void wsf::comm::router::ProtocolInterface::PerfectConnectionRemoved |
( |
double | aSimTime, |
|
|
const Address & | aSourceAddress, |
|
|
const Address & | aDestinationAddress ) |
|
inlinevirtual |
◆ PerfectNetworkAdded()
| virtual void wsf::comm::router::ProtocolInterface::PerfectNetworkAdded |
( |
double | aSimTime, |
|
|
Network * | aNetworkPtr ) |
|
inlinevirtual |
◆ PerfectNetworkRemoved()
| virtual void wsf::comm::router::ProtocolInterface::PerfectNetworkRemoved |
( |
double | aSimTime, |
|
|
Network * | aNetworkPtr ) |
|
inlinevirtual |
◆ ProcessInput()
| bool wsf::comm::router::ProtocolInterface::ProcessInput |
( |
UtInput & | aInput | ) |
|
|
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.
- Parameters
-
- Returns
- true if the current command was recognized (and processed), or false if the command was not recognized.
- Exceptions
-
| UtInput::ExceptionBase | if an invalid input was encountered. |
Reimplemented from WsfComponent.
Reimplemented in wsf::comm::router::ProtocolOSPF, and wsf::comm::router::rip::RIPv2.
Referenced by wsf::comm::router::rip::RIPv2::ProcessInput().
◆ QueryInterface()
| void * wsf::comm::router::ProtocolInterface::QueryInterface |
( |
int | aRole | ) |
|
|
overridepure virtual |
◆ Receive()
| virtual bool wsf::comm::router::ProtocolInterface::Receive |
( |
double | aSimTime, |
|
|
const Address & | aReceivingInterface, |
|
|
Message & | aMessage, |
|
|
bool & | aOverrideForward ) |
|
inlinevirtual |
◆ Routing()
| virtual std::vector< Address > wsf::comm::router::ProtocolInterface::Routing |
( |
double | aSimTime, |
|
|
const Address & | aSendingInterface, |
|
|
size_t & | aHopNumber, |
|
|
double & | aCost, |
|
|
const Message & | aMessage ) |
|
pure virtual |
◆ Send()
| virtual bool wsf::comm::router::ProtocolInterface::Send |
( |
double | aSimTime, |
|
|
Router::SendData & | aData ) |
|
inlinevirtual |
◆ ShouldPropagateTruth()
| virtual bool wsf::comm::router::ProtocolInterface::ShouldPropagateTruth |
( |
| ) |
const |
|
pure virtual |
The documentation for this class was generated from the following file: