WSF
WsfInternalLinks Class Reference

#include <WsfInternalLinks.hpp>

Classes

struct  Addressee

Public Member Functions

 WsfInternalLinks ()
 WsfInternalLinks (const WsfInternalLinks &aSrc)
 Copy constructor.
WsfInternalLinksoperator= (const WsfInternalLinks &aRhs)
 Assignment constructor.
 ~WsfInternalLinks ()
bool HasLinks () const
bool Initialize (double aSimTime, WsfPlatformPart *aPlatformPartPtr)
bool ProcessInput (UtInput &aInput)
void AddRecipient (WsfStringId aRecipientId)
 Add a link to the platform part with the given name.
bool AddRecipient (WsfPlatformPart *aRecipientPtr)
bool SetStatus (WsfStringId aRecipientId, bool aActive)
bool RemoveLink (WsfStringId aRecipientId)
void SendMessage (double aSimTime, const WsfMessage &aMessage)
void SendMessage (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
unsigned int GetRecipientCount () const
WsfPlatformPartGetRecipientEntry (unsigned int aEntry) const

Protected Member Functions

void ClearRecipients ()

Detailed Description

A connection to one or more platform part over which a message can be sent.

This class implements the ability for a platform part (a processor, comm, sensor, etc.) to send a 'message' to another platform part on the same platform.

Constructor & Destructor Documentation

◆ WsfInternalLinks() [1/2]

WsfInternalLinks::WsfInternalLinks ( )

Referenced by operator=(), and WsfInternalLinks().

◆ WsfInternalLinks() [2/2]

WsfInternalLinks::WsfInternalLinks ( const WsfInternalLinks & aSrc)

Copy constructor.

References WsfInternalLinks().

◆ ~WsfInternalLinks()

WsfInternalLinks::~WsfInternalLinks ( )

References ClearRecipients().

Member Function Documentation

◆ AddRecipient() [1/2]

bool WsfInternalLinks::AddRecipient ( WsfPlatformPart * aRecipientPtr)

Add a link to the platform part

Returns
'true' if the link was successfully created

References AddRecipient(), WsfObject::GetNameId(), and ok.

◆ AddRecipient() [2/2]

void WsfInternalLinks::AddRecipient ( WsfStringId aRecipientId)

Add a link to the platform part with the given name.

Referenced by AddRecipient(), WsfRIPRProcessor::Initialize(), and ProcessInput().

◆ ClearRecipients()

void WsfInternalLinks::ClearRecipients ( )
protected

Referenced by ProcessInput(), and ~WsfInternalLinks().

◆ GetRecipientCount()

unsigned int WsfInternalLinks::GetRecipientCount ( ) const
inline

Return the number of recipients.

Note
This is valid only after initialization

Referenced by getInternallyLinkedPlatformParts().

◆ GetRecipientEntry()

WsfPlatformPart * WsfInternalLinks::GetRecipientEntry ( unsigned int aEntry) const
inline

Return a pointer to the recipient entry. If the part link is inactive, will return zero.

Note
This is valid only after initialization

References WsfInternalLinks::Addressee::mIsActive, and WsfInternalLinks::Addressee::mPartPtr.

Referenced by getInternallyLinkedPlatformParts().

◆ HasLinks()

bool WsfInternalLinks::HasLinks ( ) const
inline

Have links been established?

Returns
'true' if one or more links have been established; 'false' if no links have been established.
Note
A caller can use this to determine if anyone might be interested in a message before going through the overhead of creating the message.

◆ Initialize()

bool WsfInternalLinks::Initialize ( double aSimTime,
WsfPlatformPart * aPlatformPartPtr )

Initialize the links to the requested platform parts.

Note
This function used to return false if any named links failed, but now merely prints a warning message, as derived classes sometimes delete certain parts.
Parameters
aSimTimeThe current simulation time.
aPlatformPartPtrThe platform part pointer to which this is attached.
Returns
'true'.

◆ operator=()

WsfInternalLinks & WsfInternalLinks::operator= ( const WsfInternalLinks & aRhs)

Assignment constructor.

References WsfInternalLinks().

◆ ProcessInput()

bool WsfInternalLinks::ProcessInput ( UtInput & aInput)

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputA generic input.
Returns
'true' if the command was one recognized by the class or 'false' if not.

References AddRecipient(), and ClearRecipients().

Referenced by WsfMessageProcessor::Action::ProcessInput().

◆ RemoveLink()

bool WsfInternalLinks::RemoveLink ( WsfStringId aRecipientId)

Take out the link to the specified platform part. The effect will be permanent.

Parameters
aRecipientIdThe recipient to remove.

◆ SendMessage() [1/2]

void WsfInternalLinks::SendMessage ( double aSimTime,
const WsfMessage & aMessage )

Send a message to a list of registered platform parts.

Parameters
aSimTimeThe current simulation time.
aMessageThe message to be sent.
Note
The WsfProcessor::ReceiveMessage method of all platform parts previously registered will be called to receive the message.

References WsfMessage::GetSubType(), and WsfMessage::GetType().

◆ SendMessage() [2/2]

void WsfInternalLinks::SendMessage ( double aSimTime,
const WsfMessage & aMessage,
WsfStringId aRecipientId )

◆ SetStatus()

bool WsfInternalLinks::SetStatus ( WsfStringId aRecipientId,
bool aActive )

Activate or deactivate sending to the specified platform part.

Note
Method to be used only during run time.
Parameters
aRecipientIdThe desired recipient to change send status for.
aActiveTrue if the desire is to enable sending, false if disabling.
Returns
'true' If the active status was changed to the desired status.

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