WSF
wsf::xio::CommComponent Class Reference

The hardware component that can be attached to all comm systems. More...

#include <WsfXIO_CommComponent.hpp>

Inheritance diagram for wsf::xio::CommComponent:
Collaboration diagram for wsf::xio::CommComponent:

Public Member Functions

 CommComponent (WsfXIO_AutoDisMapping *aDisMappingPtr, WsfXIO_Connection *aConnectionPtr)
 CommComponent (const CommComponent &aSrc)=default
 ~CommComponent () override=default
Public Member Functions inherited from wsf::comm::Component
 Component ()=default
 ~Component () override=default
CommGetComm () const
WsfPlatformGetPlatform () const
WsfSimulationGetSimulation () const
virtual void TurnOn (double aSimTime)
virtual void TurnOff (double aSimTime)
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)
virtual void AttemptToTransmit (double aSimTime, Result &aResult)
virtual void AttemptToReceive (double aSimTime, Result &aResult)
virtual bool CanInteractWith (const Comm *aXmtrPtr)
virtual bool Send (double aSimTime, const WsfMessage &aMessage, const Address &aAddress)
Public Member Functions inherited from WsfComponentT< Comm >
 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 ()

Static Public Member Functions

static CommComponentFind (const wsf::comm::Comm &aParent)
 Find the instance of this component attached to the specified processor.
static CommComponentFindOrCreate (wsf::comm::Comm &aParent, WsfXIO_AutoDisMapping *aDisMappingPtr, WsfXIO_Connection *aConnectionPtr)
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)

Interface from WsfCommComponent.

bool Receive (double aSimTime, wsf::comm::Comm *aXmtrPtr, wsf::comm::Message &aMessage) override

Required interface from WsfComponent.

WsfComponentCloneComponent () const override
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override

Additional Inherited Members

Public Types inherited from WsfComponentT< Comm >
typedef Comm ParentType
 This is needed to support the WsfComponentList template.

Detailed Description

The hardware component that can be attached to all comm systems.

Constructor & Destructor Documentation

◆ CommComponent() [1/2]

wsf::xio::CommComponent::CommComponent ( WsfXIO_AutoDisMapping * aDisMappingPtr,
WsfXIO_Connection * aConnectionPtr )

◆ CommComponent() [2/2]

wsf::xio::CommComponent::CommComponent ( const CommComponent & aSrc)
default

References CommComponent().

◆ ~CommComponent()

wsf::xio::CommComponent::~CommComponent ( )
overridedefault

Member Function Documentation

◆ CloneComponent()

WsfComponent * wsf::xio::CommComponent::CloneComponent ( ) const
overridevirtual

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

Implements WsfComponent.

References CommComponent().

◆ Find()

CommComponent * wsf::xio::CommComponent::Find ( const wsf::comm::Comm & aParent)
static

Find the instance of this component attached to the specified processor.

References CommComponent(), WsfComponentList::FindByRole(), and wsf::comm::Comm::GetComponents().

Referenced by FindOrCreate().

◆ FindOrCreate()

CommComponent * wsf::xio::CommComponent::FindOrCreate ( wsf::comm::Comm & aParent,
WsfXIO_AutoDisMapping * aDisMappingPtr,
WsfXIO_Connection * aConnectionPtr )
static

Find the instance of this component attached to the specified processor, and create it if it doesn't exist.

References WsfComponentListT< COMPONENT_TYPE >::AddComponent(), CommComponent(), Find(), and wsf::comm::Comm::GetComponents().

Referenced by WsfXIO_AutoDisMapping::NewDisPlatform().

◆ GetComponentName()

WsfStringId wsf::xio::CommComponent::GetComponentName ( ) const
overridevirtual

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.

◆ GetComponentRoles()

const int * wsf::xio::CommComponent::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 WsfComponent.

References cWSF_COMPONENT_COMM, cWSF_COMPONENT_COMM_XIO, and cWSF_COMPONENT_NULL.

◆ QueryInterface()

void * wsf::xio::CommComponent::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 WsfComponent.

References wsf::comm::Component::Component(), cWSF_COMPONENT_COMM, and cWSF_COMPONENT_COMM_XIO.

◆ Receive()


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