WSF
WsfXIO_Interface Class Reference

#include <WsfXIO_Interface.hpp>

Inheritance diagram for WsfXIO_Interface:
Collaboration diagram for WsfXIO_Interface:

Classes

class  ClockSource

Public Types

typedef std::pair< int, int > SenderAddress
typedef std::vector< WsfXIO_Connection * > ConnectionList
typedef UtCallbackN< void(WsfXIO_Connection *)> ConnectionCallback
typedef UtCallbackListN< void(WsfXIO_Connection *)> ConnectionCallbackList
Public Types inherited from WsfXIO_InputData
enum  UDP_Type { cBROADCAST , cMULTICAST , cUNICAST }

Public Member Functions

 WsfXIO_Interface ()
 This form is used when the caller is not a WSF simulation.
 WsfXIO_Interface (const WsfXIO_InputData &aInputData)
 This form is used when the caller is a WSF simulation.
 ~WsfXIO_Interface ()
Public Member Functions inherited from WsfXIO_InputData
 WsfXIO_InputData ()
bool ProcessInput (UtInput &aInput)
void AddConnectType (int aApplicationType)
 Specifies that applications of a certain type will be automatically connected to.

Miscellaneous methods.

bool IsXIO_Requested () const
 Was a network connection requested?
void SetXIO_Requested ()
bool ShowConnections () const
 Should connection status messages be shown?
void SetShowConnections (bool aShowConnections)
bool IsDebugEnabled () const
 Was detailed debugging information requested?
void SetDebugEnabled (bool aIsEnabled)
void GetBytesCommunicated (size_t &aBytesSent, size_t &aBytesReceived)

Various callbacks to which others can subscribe.

UtCallbackListN< void(WsfXIO_Connection *)> OnConnected
 Invoked when a connection is initialized.
UtCallbackListN< void(WsfXIO_Connection *)> OnDisconnected
 Invoked when a connection is no longer connected, prior to deletion.
UtCallbackListN< void(double, GenUniqueId, bool)> OnHeartbeatUpdate
UtCallbackListN< void(bool, const std::string &)> OnApplicationBehind
 Invoked when a connected application has fallen behind the real-time clock by some threshold, or is no longer behind.
UtCallbackListN< void(int, int, int, int, double)> BandwidthDataEvent
 Executes on the heartbeat to provide bandwidth information to event output.
std::unique_ptr< UtCallbackN< void()> > TimeoutConnect (double aWaitTime, const std::function< void()> &aFunction)
std::unique_ptr< ConnectionCallbackDisconnectConnect (WsfXIO_Connection *aConnectionPtr, const ConnectionCallback::FunctionType &aFunction)

Application identification methods

const GenUniqueId & GetApplicationId () const
void SetApplicationName (const std::string &aApplicationName)
std::string GetApplicationName () const
void SetApplicationType (wsf::xio::ApplicationType aApplicationType)
bool Initialize ()
void AdvanceTime (double aSimTime)

Simulation clock methods.

double GetSimTime () const
 Returns the current simulation time.
double GetLastAdvanceTime () const
void SetClockSource (ClockSource *aClockSourcePtr)

Packet send methods.

void Send (WsfXIO_Packet &aPktPtr, WsfXIO_Connection *aConnectionPtr)
void Send (WsfXIO_Packet &aPkt, WsfXIO_Destination &aDestination)
void Send (WsfXIO_Packet &aPktPtr, const std::vector< PakSocketIO * > &aConnections)
void SendToAll (WsfXIO_Packet &aPkt)
void SendToAllUDP (WsfXIO_Packet &aPkt)
void SendToAllTCP (WsfXIO_Packet &aPkt)
void SetValidApplicationTypes (const std::vector< int > &aApplicationTypes)
WsfXIO_ConnectionGetSender (PakPacket &aPkt)

Accessors to objects maintained by this class.

WsfXIO_RequestManagerGetRequestManager ()
WsfXIO_QueryManagerGetQueryManager () const
WsfXIO_PublisherGetPublisher () const

Service management

void RegisterServiceType (std::string aServiceType, std::string aServiceVersion=std::string())
 Specifies that a service is available by this application.

Connection management

void AddUDP_Target (UDP_Target aTarget)
 Adds a connection target. Can be called before or after initialization.
bool RemoveUDP_Target (int aTargetIndex)
const std::vector< UDP_Target > & GetUDP_Targets ()
const ConnectionListGetConnections () const
const ConnectionListGetReliableConnections () const
WsfXIO_ConnectionFindConnection (const GenUniqueId &aApplicationId)
WsfXIO_ConnectionFindConnection (int aConnectionIndex)
 Returns a pointer to the connection with the given ID.
WsfXIO_ConnectionFindConnection (const std::string &aApplicationName)
void Disconnect (WsfXIO_Connection *aConnectionPtr)

Additional Inherited Members

Public Attributes inherited from WsfXIO_InputData
InputCallbackList ProcessInputEvent
 XIO extenders can subscribe to this to add additional input into the 'xio_interface' block.
WsfStringId mApplicationName
 The current application's name.
int mTCP_Port
 Socket port used to receive TCP connections.
int mMulticastTimeToLive
 Time to live for multicast connections.
bool mMulticastLoopback
 Determines if sent multicast can be received on the local machine.
double mHeartbeatInterval
ut::optional< double > mFallingBehindThreshold
std::set< int > mApplicationTypeFilter
 Set of application types to connect with automatically.
std::vector< UDP_TargetmUDP_Targets
 Contains user input UDP target information.
std::vector< WsfXIO_EntityIdmRegularApplications
std::vector< WsfXIO_EntityIdmAutoMappedApplications
bool mAutoMappingDefault
int mPublisherDebugLevel
bool mDebugEnabled
bool mShowConnections
bool mShowTransferRate
bool mPauseForConnection
bool mInterfaceRequested
 true if user has requested the XIO interface
bool mAuxDataUpdates = true

Detailed Description

This is communications interface for XIO. It is responsible for:

  • Maintaining all XIO connections to other applications
  • Sending out heartbeat messages via UDP connections
  • Connecting to applications upon receipt of heartbeats
  • Sending and receiving of data

Member Typedef Documentation

◆ ConnectionCallback

◆ ConnectionCallbackList

◆ ConnectionList

◆ SenderAddress

typedef std::pair<int, int> WsfXIO_Interface::SenderAddress

Constructor & Destructor Documentation

◆ WsfXIO_Interface() [1/2]

WsfXIO_Interface::WsfXIO_Interface ( )

This form is used when the caller is not a WSF simulation.

References WsfXIO_InputData::WsfXIO_InputData(), and WsfXIO_Interface().

Referenced by WsfXIO_Interface().

◆ WsfXIO_Interface() [2/2]

◆ ~WsfXIO_Interface()

WsfXIO_Interface::~WsfXIO_Interface ( )

Member Function Documentation

◆ AddUDP_Target()

void WsfXIO_Interface::AddUDP_Target ( UDP_Target aTarget)

Adds a connection target. Can be called before or after initialization.

References WsfXIO_InputData::mInterfaceRequested, and WsfXIO_InputData::mUDP_Targets.

◆ AdvanceTime()

◆ Disconnect()

void WsfXIO_Interface::Disconnect ( WsfXIO_Connection * aConnectionPtr)

References WsfXIO_Connection::GetIO().

Referenced by RemoveUDP_Target().

◆ DisconnectConnect()

std::unique_ptr< WsfXIO_Interface::ConnectionCallback > WsfXIO_Interface::DisconnectConnect ( WsfXIO_Connection * aConnectionPtr,
const ConnectionCallback::FunctionType & aFunction )

◆ FindConnection() [1/3]

WsfXIO_Connection * WsfXIO_Interface::FindConnection ( const GenUniqueId & aApplicationId)

◆ FindConnection() [2/3]

WsfXIO_Connection * WsfXIO_Interface::FindConnection ( const std::string & aApplicationName)

◆ FindConnection() [3/3]

WsfXIO_Connection * WsfXIO_Interface::FindConnection ( int aConnectionIndex)

Returns a pointer to the connection with the given ID.

◆ GetApplicationId()

const GenUniqueId & WsfXIO_Interface::GetApplicationId ( ) const
inline

◆ GetApplicationName()

std::string WsfXIO_Interface::GetApplicationName ( ) const
inline

◆ GetBytesCommunicated()

void WsfXIO_Interface::GetBytesCommunicated ( size_t & aBytesSent,
size_t & aBytesReceived )

◆ GetConnections()

const ConnectionList & WsfXIO_Interface::GetConnections ( ) const
inline

◆ GetLastAdvanceTime()

double WsfXIO_Interface::GetLastAdvanceTime ( ) const
inline

◆ GetPublisher()

WsfXIO_Publisher & WsfXIO_Interface::GetPublisher ( ) const
inline

◆ GetQueryManager()

WsfXIO_QueryManager & WsfXIO_Interface::GetQueryManager ( ) const
inline

◆ GetReliableConnections()

const ConnectionList & WsfXIO_Interface::GetReliableConnections ( ) const
inline

◆ GetRequestManager()

WsfXIO_RequestManager & WsfXIO_Interface::GetRequestManager ( )
inline

◆ GetSender()

WsfXIO_Connection * WsfXIO_Interface::GetSender ( PakPacket & aPkt)

◆ GetSimTime()

double WsfXIO_Interface::GetSimTime ( ) const
inline

Returns the current simulation time.

Referenced by Send(), Send(), SendToAll(), and SendToAllUDP().

◆ GetUDP_Targets()

const std::vector< UDP_Target > & WsfXIO_Interface::GetUDP_Targets ( )
inline

◆ Initialize()

◆ IsDebugEnabled()

bool WsfXIO_Interface::IsDebugEnabled ( ) const
inline

Was detailed debugging information requested?

References WsfXIO_InputData::mDebugEnabled.

Referenced by ~WsfXIO_Interface().

◆ IsXIO_Requested()

bool WsfXIO_Interface::IsXIO_Requested ( ) const
inline

Was a network connection requested?

References WsfXIO_InputData::mInterfaceRequested.

◆ RegisterServiceType()

void WsfXIO_Interface::RegisterServiceType ( std::string aServiceType,
std::string aServiceVersion = std::string() )

Specifies that a service is available by this application.

◆ RemoveUDP_Target()

bool WsfXIO_Interface::RemoveUDP_Target ( int aTargetIndex)

◆ Send() [1/3]

void WsfXIO_Interface::Send ( WsfXIO_Packet & aPkt,
WsfXIO_Destination & aDestination )

◆ Send() [2/3]

void WsfXIO_Interface::Send ( WsfXIO_Packet & aPktPtr,
const std::vector< PakSocketIO * > & aConnections )

◆ Send() [3/3]

void WsfXIO_Interface::Send ( WsfXIO_Packet & aPktPtr,
WsfXIO_Connection * aConnectionPtr )

◆ SendToAll()

void WsfXIO_Interface::SendToAll ( WsfXIO_Packet & aPkt)

◆ SendToAllTCP()

void WsfXIO_Interface::SendToAllTCP ( WsfXIO_Packet & aPkt)

◆ SendToAllUDP()

void WsfXIO_Interface::SendToAllUDP ( WsfXIO_Packet & aPkt)

◆ SetApplicationName()

void WsfXIO_Interface::SetApplicationName ( const std::string & aApplicationName)
inline

◆ SetApplicationType()

void WsfXIO_Interface::SetApplicationType ( wsf::xio::ApplicationType aApplicationType)
inline

◆ SetClockSource()

void WsfXIO_Interface::SetClockSource ( ClockSource * aClockSourcePtr)

◆ SetDebugEnabled()

void WsfXIO_Interface::SetDebugEnabled ( bool aIsEnabled)
inline

◆ SetShowConnections()

void WsfXIO_Interface::SetShowConnections ( bool aShowConnections)
inline

◆ SetValidApplicationTypes()

void WsfXIO_Interface::SetValidApplicationTypes ( const std::vector< int > & aApplicationTypes)

References GetSender().

◆ SetXIO_Requested()

void WsfXIO_Interface::SetXIO_Requested ( )
inline

◆ ShowConnections()

bool WsfXIO_Interface::ShowConnections ( ) const
inline

Should connection status messages be shown?

References WsfXIO_InputData::mShowConnections.

◆ TimeoutConnect()

std::unique_ptr< UtCallbackN< void()> > WsfXIO_Interface::TimeoutConnect ( double aWaitTime,
const std::function< void()> & aFunction )

Member Data Documentation

◆ BandwidthDataEvent

UtCallbackListN<void(int, int, int, int, double)> WsfXIO_Interface::BandwidthDataEvent

Executes on the heartbeat to provide bandwidth information to event output.

Referenced by AdvanceTime().

◆ OnApplicationBehind

UtCallbackListN<void(bool, const std::string&)> WsfXIO_Interface::OnApplicationBehind

Invoked when a connected application has fallen behind the real-time clock by some threshold, or is no longer behind.

Referenced by WsfXIO_Interface().

◆ OnConnected

UtCallbackListN<void(WsfXIO_Connection*)> WsfXIO_Interface::OnConnected

Invoked when a connection is initialized.

◆ OnDisconnected

UtCallbackListN<void(WsfXIO_Connection*)> WsfXIO_Interface::OnDisconnected

Invoked when a connection is no longer connected, prior to deletion.

Referenced by WsfXIO_Interface(), and WsfXIO_RequestManager::WsfXIO_RequestManager().

◆ OnHeartbeatUpdate

UtCallbackListN<void(double, GenUniqueId, bool)> WsfXIO_Interface::OnHeartbeatUpdate

Invoked when a heartbeat is sent or received. double = Time Stamp GenUniqueId = ApplicationId bool = Received (!Sent)

Referenced by wsf::xio::EventPipe::EventPipe().


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