WSF
wsf::comm::router::rip::RIPv2 Class Reference

#include <WsfCommProtocolRIPv2.hpp>

Inheritance diagram for wsf::comm::router::rip::RIPv2:
Collaboration diagram for wsf::comm::router::rip::RIPv2:

Public Member Functions

 RIPv2 ()=default
 RIPv2 (const RIPv2 &aSrc)
 RIPv2 (RIPv2 &&)=default
RIPv2operator= (RIPv2 &&)=default
 ~RIPv2 () override=default
WsfComponentCloneComponent () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
bool ProcessInput (UtInput &aInput) override
bool Initialize (double aSimTime) override
RIPv2Clone () const override
void TurnOn (double aSimTime, Router *aRouterPtr)
bool ShouldPropagateTruth () const override
graph::GraphGetGraph () const override
int GetPriority () const override
std::vector< AddressRouting (double aSimTime, const Address &aSendingInterface, size_t &aHopNumber, double &aCost, const wsf::comm::Message &aMessage) override
bool Send (double aSimTime, Router::SendData &aData) override
bool Receive (double aSimTime, const Address &aReceivingInterface, wsf::comm::Message &aMessage, bool &aOverrideForward) override
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 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
RouterGetRouter () const
WsfSimulationGetSimulation () const
NetworkManagerGetNetworkManager () const
virtual void Setup ()
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 ()
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
virtual void ComponentParentChanged (ParentType *aParentPtr)
ParentTypeGetComponentParent () 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 TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (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 Attributes

static constexpr const char * cRIP_DATAGRAM = "RIP_datagram"
static constexpr const char * cRIP_MESSAGE = "RIP_MESSAGE"

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< WsfStringIdTypeList
 The list of types returned by GetTypeList.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Constructor & Destructor Documentation

◆ RIPv2() [1/3]

wsf::comm::router::rip::RIPv2::RIPv2 ( )
default

References RIPv2().

Referenced by Clone(), operator=(), RIPv2(), RIPv2(), and RIPv2().

◆ RIPv2() [2/3]

wsf::comm::router::rip::RIPv2::RIPv2 ( const RIPv2 & aSrc)

◆ RIPv2() [3/3]

wsf::comm::router::rip::RIPv2::RIPv2 ( RIPv2 && )
default

References RIPv2().

◆ ~RIPv2()

wsf::comm::router::rip::RIPv2::~RIPv2 ( )
overridedefault

Member Function Documentation

◆ Clone()

RIPv2 * wsf::comm::router::rip::RIPv2::Clone ( ) const
inlineoverridevirtual

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 RIPv2().

Referenced by CloneComponent().

◆ CloneComponent()

WsfComponent * wsf::comm::router::rip::RIPv2::CloneComponent ( ) const
inlineoverridevirtual

Clones a component. May return null if component does not support clone.

Implements wsf::comm::router::ProtocolInterface.

References Clone().

◆ GetComponentRoles()

const int * wsf::comm::router::rip::RIPv2::GetComponentRoles ( ) const
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:

return roles;
@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

Implements wsf::comm::router::ProtocolInterface.

References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_RIPv2, and cWSF_COMPONENT_NULL.

◆ GetGraph()

graph::Graph * wsf::comm::router::rip::RIPv2::GetGraph ( ) const
inlineoverridevirtual

◆ GetPriority()

int wsf::comm::router::rip::RIPv2::GetPriority ( ) const
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::cRIPv2.

◆ Initialize()

bool wsf::comm::router::rip::RIPv2::Initialize ( double aSimTime)
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.

Parameters
aSimTimeThe 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 wsf::comm::router::ProtocolInterface.

References wsf::comm::router::RouterComponent::GetSimulation(), WsfObserver::RouterTurnedOn(), and TurnOn().

◆ operator=()

RIPv2 & wsf::comm::router::rip::RIPv2::operator= ( RIPv2 && )
default

References RIPv2().

◆ ProcessInput()

bool wsf::comm::router::rip::RIPv2::ProcessInput ( UtInput & aInput)
overridevirtual

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
aInputThe input stream.
Returns
true if the current command was recognized (and processed), or false if the command was not recognized.
Exceptions
UtInput::ExceptionBaseif an invalid input was encountered.

Reimplemented from wsf::comm::router::ProtocolInterface.

References wsf::comm::router::ProtocolInterface::ProcessInput().

◆ QueryInterface()

void * wsf::comm::router::rip::RIPv2::QueryInterface ( int aRole)
overridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Implements wsf::comm::router::ProtocolInterface.

References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_RIPv2, and cWSF_COMPONENT_NULL.

◆ Receive()

bool wsf::comm::router::rip::RIPv2::Receive ( double aSimTime,
const Address & aReceivingInterface,
wsf::comm::Message & aMessage,
bool & aOverrideForward )
overridevirtual

◆ Routing()

std::vector< Address > wsf::comm::router::rip::RIPv2::Routing ( double aSimTime,
const Address & aSendingInterface,
size_t & aHopNumber,
double & aCost,
const wsf::comm::Message & aMessage )
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.

Implements wsf::comm::router::ProtocolInterface.

References wsf::comm::Address::GetAddress(), wsf::comm::router::RouterComponent::GetRouter(), and wsf::comm::Message::SourceMessage().

Referenced by Send().

◆ Send()

◆ ShouldPropagateTruth()

bool wsf::comm::router::rip::RIPv2::ShouldPropagateTruth ( ) const
inlineoverridevirtual

◆ TurnOn()

Member Data Documentation

◆ cRIP_DATAGRAM

const char* wsf::comm::router::rip::RIPv2::cRIP_DATAGRAM = "RIP_datagram"
staticconstexpr

Referenced by Receive().

◆ cRIP_MESSAGE

const char * wsf::comm::router::rip::RIPv2::cRIP_MESSAGE = "RIP_MESSAGE"
staticconstexpr

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved