WSF
wsf::comm::NetworkManager Class Reference

#include <WsfCommNetworkManager.hpp>

Inheritance diagram for wsf::comm::NetworkManager:
Collaboration diagram for wsf::comm::NetworkManager:

Classes

struct  CommHash

Public Types

enum class  NetworkTopology {
  cPOINT_TO_POINT , cMESH , cSTAR , cRING ,
  cDIRECTED_RING
}
using CommMap = std::unordered_map<Address, Comm*>
 Definitions of commonly used container types.
using AddressMap = std::unordered_map<Comm*, Address, CommHash>
using AddressSet = std::unordered_set<Address>
using NetworkSet = std::set<Address>
using AddressNetworkMap = std::unordered_map<Address, std::string>
using NetworkMap = std::unordered_map<std::string, std::unique_ptr<Network>>
using AddressVector = std::vector<Address>
using MultiAddressMap = std::unordered_map<Address, AddressVector>
using CommVector = std::vector<Comm*>
using RouterVector = std::vector<router::Router*>

Public Member Functions

 NetworkManager (WsfSimulation *aSimPtr)
 Constructors and Operator Overloads.
 ~NetworkManager () override=default
 NetworkManager (const NetworkManager &aSrc)=delete
NetworkManageroperator= (const NetworkManager &aSrc)=delete
 NetworkManager (NetworkManager &&aSrc)=delete
NetworkManageroperator= (NetworkManager &&aSrc)=delete
Public Member Functions inherited from WsfSimulationExtension
 WsfSimulationExtension ()
 ~WsfSimulationExtension () override=default
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
virtual void AddedToSimulation ()
virtual bool PrepareExtension ()
virtual void Start ()
virtual void Complete (double aSimTime)
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const

Static Public Member Functions

static NetworkManagerFind (const WsfSimulation &aSimulation)
static void __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr)

Callback lists.

Other objects may register callbacks that are to be invoked during network manager network graph state changes. NOTE: Be aware that these objects are called as processed by the network manager. It should not be assumed that they are called in a logical order (such as adding a comm before enabling a link to it), so any use of these must be robust enough to accommodate potential information that has not yet propagated.

UtCallbackListN< void(double, Comm *)> CommAdded {}
UtCallbackListN< void(double, Comm *)> CommRemoved {}
UtCallbackListN< void(double, Network *)> NetworkAdded {}
UtCallbackListN< void(double, Network *)> NetworkRemoved {}
UtCallbackListN< void(double, Comm *)> CommEnabled {}
UtCallbackListN< void(double, Comm *)> CommDisabled {}
UtCallbackListN< void(double, const Address &, const Address &)> ConnectionAdded {}
UtCallbackListN< void(double, const Address &, const Address &)> ConnectionRemoved {}
UtCallbackListN< void(double, const Address &, const Address &)> ConnectionEnabled {}
UtCallbackListN< void(double, const Address &, const Address &)> ConnectionDisabled {}
UtCallbackListN< void()> CommFrameworkPendingStart {}
 Allows indication that the comm framework is fully set up.
UtCallbackListN< void(double, WsfPlatform *)> CommFrameworkPlatformInitialized {}
 Filtered PlatformInitialized event, called after the comm framework has processed this platform.
UtCallbackListN< void(double, WsfPlatform *)> CommFrameworkPlatformDeleted {}
 Filtered PlatformDeleted event, called prior to the comm framework removing this platform.

Notifications from the simulation.

These are called in the order they are listed.

bool Initialize () override
bool PlatformsInitialized () override
void PendingStart () override
const AddressGetAddress (Comm *aCommPtr) const
 Accessors.
CommGetComm (const Address &aAddress) const
 Provides Comm object for an Address.
NetworkGetNetwork (const std::string &aNetworkName) const
 Provides Network object for a network name.
bool IsCommManaged (Comm *aCommPtr) const
 True if Comm object present.
bool IsAddressManaged (const Address &aAddress) const
 True if Address object present.
bool IsNetworkManaged (const std::string &aNetworkName) const
 True if network with name provided present.
std::vector< std::string > GetManagedNetworks () const
 Returns the names of all managed networks.
const AddressGetManagingNetworkAddress (const Address &aAddress) const
 Returns the address of the network that the provided address belongs to.
bool IsNetworkAddressManaged (const Address &aAddress) const
 True if network address provided overlaps with a currently assigned network address.
std::string GetNetworkNameFromAddress (const Address &aAddress) const
 Get name of network associated with an Address.
AddressSet GetAddressesInNetwork (const std::string &aNetworkName) const
 Get a list of all addresses associated with a network.
AddressSet GetComms () const
 Returns all registered comms in the simulation.
graph::GraphGetGraph ()
 Get the graph representation of all comm networks in AFSIM (perfect knowledge).
bool PathExists (const Address &aSourceAddress, const Address &aDestinationAddress) const
 Simple check of pathing from source to destination.
bool HasMulticastMember (const Address &aMulticastAddress, const std::string &aNetworkName) const
 Returns true if the network has a comm subscribed to the provided multicast address.
AddressSet GetMulticastMembers (const Address &aMulticastAddress, const std::string &aNetworkName) const
 Returns the members of a network subscribed to a multicast address.
AddressSet GetMulticastMembers (const Address &aMulticastAddress) const
 Returns ALL members of a multicast address.
bool IsMulticastManaged (const Address &aMulticastAddress) const
 True if a multicast address being utilized/managed.

AddManagedComm

Adds a comm (during its initialization routine) to a container of interfaces that are processed during the PlatformsInitialized() call. Required for ALL comm implementations being managed by the network manager via scenario input.

void AddManagedComm (Comm *aCommPtr)

AddManagedRouter

Adds a router (during its initialization routine) to a container that is processed during the PlatformsInitialized() call. Required for ALL router implementations being managed by the network manager.

void AddManagedRouter (router::Router *aRouterPtr)

AddComm

Adds a comm device to the network manager. The first version of this method will look for an existing network, if the value was provided, and add the comm device to that network with an appropriate address, if possible. If no network was specified, a new address will be assigned, with a new network created containing only this comm device. The assigned address of the comm device is returned, with an address of 0.0.0.0 provided upon failure to add the device. The second version checks the user provided address to see if it belongs to an existing network. If so, the device is added to that network with the user specified address. If the address does not belong to a current network assignment, a new network is created to which this device is assigned. The second version returns the name of the network that the comm was assigned to, or a empty string ("") on failure.

Address AddComm (double aSimTime, Comm *aCommPtr, std::string &aNetworkName, bool aNotifyObserver=true)
std::string AddComm (double aSimTime, Comm *aCommPtr, const Address &aAddress, bool aNotifyObserver=true)

RemoveComm

Removes the comm device and all applicable mappings from the network manager. Can be performed by providing either a pointer to the comm device, or an address.

void RemoveComm (double aSimTIme, Comm *aCommPtr, bool aNotifyObserver=true)
void RemoveComm (double aSimTime, const Address &aAddress, bool aNotifyObserver=true)

AddNetwork

Adds a network to the network manager. The passed boolean value indicates whether reserved addressing is enforced, as this needs to be disabled during initial setup.

bool AddNetwork (double aSimTime, std::unique_ptr< Network > aNetwork, bool aSuppressReservedCheck=false)

RemoveNetwork

Removes a network from the network manager.

Note
Removal of the network also removes the management of any associated comms and their addresses from network management.
void RemoveNetwork (double aSimTime, const std::string &aNetworkName)

EnableComm

Given a comm device or an address, enables the object (node) within the graph.

bool EnableComm (double aSimTime, Comm *aCommPtr)
bool EnableComm (double aSimTime, const Address &aAddress)

DisableComm

Given a comm device or an address, disables the object (node) within the graph.

bool DisableComm (double aSimTime, Comm *aCommPtr)
bool DisableComm (double aSimTime, const Address &aAddress)

AddConnection

Given two comm devices, create a connection (edge) on the graph.

bool AddConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinationCommPtr, bool aNotifyObserver=true)
bool AddConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true)

RemoveConnection

Given two comm devices, remove a connection (edge) on the graph.

bool RemoveConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinationCommPtr, bool aNotifyObserver=true)
bool RemoveConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true)

EnableConnection

Given two comm devices, enable a connection (edge) on the graph.

bool EnableConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinationCommPtr, bool aNotifyObserver=true)
bool EnableConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true)

DisableConnection

Given two comm devices, disable a connection (edge) on the graph.

bool DisableConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinaationCommPtr, bool aNotifyObserver=true)
bool DisableConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true)
bool AddMulticastMember (double aSimTime, const Address &aMulticastAddress, const Address &aJoiningMember)
bool RemoveMulticastMember (double aSimTime, const Address &aMulticastAddress, const Address &aLeavingMember)

RemoveNetworkConnections

Given a network name, remove all connections between members of the network.

bool RemoveNetworkConnections (double aSimTime, const std::string &aNetworkName, bool aNotifyObserver=true)

ManageComm

Based on input to the comm interface (or lack thereof), this method determines the appropriate call to AddComm to correctly assigned addressing to the interface. and then assigned the Comm to its network and assign linkage (via AddComm)

void ManageComm (double aSimTime, Comm *aCommPtr, const std::string &aNetworkName, const Address &aAddress, const Address &aNetworkAddress)

InitializeUserLinks

For any passed comm object, creates linkage based on the user input for that comm. Cannot be called until all comms in the simulation have been assigned addresses and assigned to networks due to reliance on some linkage being address based.

void InitializeUserLinks (double aSimTime, Comm *aCommPtr)

Clear

Removes all mappings and empties the graph object in the network manager.

void Clear ()

GetSimulation()

Provides an alternate point of entry for the simulation object for objects that may initially only have access to the Network Manager

WsfSimulationGetSimulation () const

Network Manager Callbacks

void PlatformDeleted (double aSimTime, WsfPlatform *aPlatform)
void PlatformInitialized (double aSimTime, WsfPlatform *aPlatform)
const ReservedAddressingGetReservedAddresses () const
 Accessor for reserved addressing object.

Additional Inherited Members

Protected Member Functions inherited from WsfExtension
void InitializeExtensionName (const std::string &aName)

Member Typedef Documentation

◆ AddressMap

◆ AddressNetworkMap

using wsf::comm::NetworkManager::AddressNetworkMap = std::unordered_map<Address, std::string>

◆ AddressSet

using wsf::comm::NetworkManager::AddressSet = std::unordered_set<Address>

◆ AddressVector

◆ CommMap

using wsf::comm::NetworkManager::CommMap = std::unordered_map<Address, Comm*>

Definitions of commonly used container types.

◆ CommVector

◆ MultiAddressMap

◆ NetworkMap

using wsf::comm::NetworkManager::NetworkMap = std::unordered_map<std::string, std::unique_ptr<Network>>

◆ NetworkSet

◆ RouterVector

Member Enumeration Documentation

◆ NetworkTopology

Enumerator
cPOINT_TO_POINT 
cMESH 
cSTAR 
cRING 
cDIRECTED_RING 

Constructor & Destructor Documentation

◆ NetworkManager() [1/3]

wsf::comm::NetworkManager::NetworkManager ( WsfSimulation * aSimPtr)

Constructors and Operator Overloads.

References WsfSimulationExtension::WsfSimulation.

Referenced by Find(), NetworkManager(), NetworkManager(), operator=(), and operator=().

◆ ~NetworkManager()

wsf::comm::NetworkManager::~NetworkManager ( )
overridedefault

◆ NetworkManager() [2/3]

wsf::comm::NetworkManager::NetworkManager ( const NetworkManager & aSrc)
delete

References NetworkManager().

◆ NetworkManager() [3/3]

wsf::comm::NetworkManager::NetworkManager ( NetworkManager && aSrc)
delete

References NetworkManager().

Member Function Documentation

◆ AddComm() [1/2]

std::string wsf::comm::NetworkManager::AddComm ( double aSimTime,
Comm * aCommPtr,
const Address & aAddress,
bool aNotifyObserver = true )

Find the network the user provided address belongs to, if it exists.

A managing network was found for the user address. Add the comm device to this network.

Set the comm's address and network name

We can't undo this earlier, due to the network needing these objects populated for for potential linking on success, so we have to undo them here on failure.

Notify the observer that a node was added to the manager

Notify callback

No current managing network for this address. Create one for this address.

The default network type is a mesh network.

New network created. Add this address to indicate its being managed.

We can't undo this earlier, due to the network needing these objects populated for for potential linking on success, so we have to undo them here on failure.

Notify the observer that a node was added to the manager

Notify callback

References AddNetwork(), CommAdded, wsf::comm::Comm::GetFullName(), GetManagingNetworkAddress(), GetNetwork(), GetNetworkNameFromAddress(), wsf::comm::Address::GetRoutingPrefix(), GetSimulation(), wsf::comm::Address::GetSubnetMaskBitLength(), IsAddressManaged(), IsCommManaged(), IsNetworkManaged(), wsf::comm::Address::IsNull(), RemoveNetwork(), wsf::comm::Comm::SetAddress(), and wsf::comm::Comm::SetNetwork().

◆ AddComm() [2/2]

Address wsf::comm::NetworkManager::AddComm ( double aSimTime,
Comm * aCommPtr,
std::string & aNetworkName,
bool aNotifyObserver = true )

If the network name is not provided, set a network name using the device name. The network is defined with the comm name with a dot and an integer value, as it is possible that the defining network comm device may leave a network and re-establish a new one during the simulation, in which a network using that name would already be established. e.g. If the comm is named "platform.blue_comm", the initial typical network name would be "platform.blue_comm.1". If that comm device left that network, but later re-established a new network with an auto-generated name, that new network would be "platform.blue_comm.2". As such, names of networks should never assume inclusion of a comm device of the same name, and are only identifiers used to identify a particular network.

The user defined a network name. If this network already exists, set a flag so we don't create that network later. Also match the CIDR value for address creation to any existing network specification.

If the above conditional determined that a network needed to be created, do so now.

Get an address that isn't already maintained (used) and that isn't reserved.

Add a default network object. Note that all default networks in AFSIM are mesh based.

Now, regardless of case above, we have a network to add this comm device to. Use that network to generate an appropriate address for this device.

Create an address that is only the base routing prefix of the network address. This represents the lowest available address assignable to this particular domain.

The initial address in an invalid *.0 address. Increment to start at the first available value, a *.001 address.

Check the address for current assignment in the simulation, incrementing the address until an available address is found. If we exhaust all available host addresses, return a failure.

Address exists. Increment address;

Address does not exist in manager, use it for this device.

Set the comm's address and network name

Add the comm to the network object. This may result in linkage.

We can't undo this earlier, due to the network needing these objects populated for for potential linking on success, so we have to undo them here on failure.

If we created a network for this failed add, remove it too.

Notify the observer that a node was added to the manager

Notify callbacks

If we reach this point, it means that the network no longer had any assignable addresses within its subnet. Return the non-assigned address of 0.0.0.0 to indicate inability to assign this comm device to this network.

References AddNetwork(), CommAdded, wsf::comm::Address::GenerateAddress(), wsf::comm::Network::GetAddress(), wsf::comm::Comm::GetFullName(), GetNetwork(), GetSimulation(), wsf::comm::Address::GetSubnetMaskBitLength(), IsAddressManaged(), IsCommManaged(), IsNetworkAddressManaged(), IsNetworkManaged(), RemoveNetwork(), wsf::comm::Comm::SetAddress(), and wsf::comm::Comm::SetNetwork().

Referenced by ManageComm(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), and wsf::comm::UT_DEFINE_SCRIPT_METHOD().

◆ AddConnection() [1/2]

bool wsf::comm::NetworkManager::AddConnection ( double aSimTime,
Comm * aSourceCommPtr,
Comm * aDestinationCommPtr,
bool aNotifyObserver = true )

References AddConnection(), and GetAddress().

Referenced by AddConnection(), and InitializeUserLinks().

◆ AddConnection() [2/2]

bool wsf::comm::NetworkManager::AddConnection ( double aSimTime,
const Address & aSourceAddress,
const Address & aDestinationAddress,
bool aNotifyObserver = true )

Links to self are not allowed.

Notify callback

References ConnectionAdded, and GetComm().

◆ AddManagedComm()

void wsf::comm::NetworkManager::AddManagedComm ( Comm * aCommPtr)
inline

◆ AddManagedRouter()

void wsf::comm::NetworkManager::AddManagedRouter ( router::Router * aRouterPtr)
inline

◆ AddMulticastMember()

bool wsf::comm::NetworkManager::AddMulticastMember ( double aSimTime,
const Address & aMulticastAddress,
const Address & aJoiningMember )

◆ AddNetwork()

bool wsf::comm::NetworkManager::AddNetwork ( double aSimTime,
std::unique_ptr< Network > aNetwork,
bool aSuppressReservedCheck = false )

If a network with this name already exists, return false for failure to add network.

Need copies of these, as std::move will invalidate aNetwork during processing.

Check for a user supplied address that is not the default

Specific address not provided. Generate one, but use current CIDR value in case the user specified one.

Add this network.

Initialize the network

Notify the observer of the new network.

Notify callback

References wsf::comm::Address::GenerateAddress(), wsf::comm::Address::GetAddress(), GetNetwork(), GetSimulation(), wsf::comm::Address::GetSubnetMaskBitLength(), IsNetworkAddressManaged(), IsNetworkManaged(), and NetworkAdded.

Referenced by AddComm(), AddComm(), Initialize(), ManageComm(), and PlatformsInitialized().

◆ Clear()

void wsf::comm::NetworkManager::Clear ( )

References wsf::comm::graph::Graph::Clear().

Referenced by Initialize().

◆ DisableComm() [1/2]

bool wsf::comm::NetworkManager::DisableComm ( double aSimTime,
Comm * aCommPtr )

References DisableComm(), and GetAddress().

Referenced by DisableComm().

◆ DisableComm() [2/2]

bool wsf::comm::NetworkManager::DisableComm ( double aSimTime,
const Address & aAddress )

Notify Callback

References CommDisabled, and GetComm().

◆ DisableConnection() [1/2]

bool wsf::comm::NetworkManager::DisableConnection ( double aSimTime,
Comm * aSourceCommPtr,
Comm * aDestinaationCommPtr,
bool aNotifyObserver = true )

References DisableConnection(), and GetAddress().

Referenced by DisableConnection().

◆ DisableConnection() [2/2]

bool wsf::comm::NetworkManager::DisableConnection ( double aSimTime,
const Address & aSourceAddress,
const Address & aDestinationAddress,
bool aNotifyObserver = true )

Notify callback

References ConnectionDisabled, and GetComm().

◆ EnableComm() [1/2]

bool wsf::comm::NetworkManager::EnableComm ( double aSimTime,
Comm * aCommPtr )

References EnableComm(), and GetAddress().

Referenced by EnableComm().

◆ EnableComm() [2/2]

bool wsf::comm::NetworkManager::EnableComm ( double aSimTime,
const Address & aAddress )

Notify callback

References CommEnabled, and GetComm().

◆ EnableConnection() [1/2]

bool wsf::comm::NetworkManager::EnableConnection ( double aSimTime,
Comm * aSourceCommPtr,
Comm * aDestinationCommPtr,
bool aNotifyObserver = true )

References EnableConnection(), and GetAddress().

Referenced by EnableConnection().

◆ EnableConnection() [2/2]

bool wsf::comm::NetworkManager::EnableConnection ( double aSimTime,
const Address & aSourceAddress,
const Address & aDestinationAddress,
bool aNotifyObserver = true )

References ConnectionEnabled, and GetComm().

◆ Find()

NetworkManager * wsf::comm::NetworkManager::Find ( const WsfSimulation & aSimulation)
static

◆ GetAddress()

const Address * wsf::comm::NetworkManager::GetAddress ( Comm * aCommPtr) const

◆ GetAddressesInNetwork()

◆ GetComm()

Comm * wsf::comm::NetworkManager::GetComm ( const Address & aAddress) const

◆ GetComms()

NetworkManager::AddressSet wsf::comm::NetworkManager::GetComms ( ) const

Returns all registered comms in the simulation.

Referenced by operator=().

◆ GetGraph()

◆ GetManagedNetworks()

std::vector< std::string > wsf::comm::NetworkManager::GetManagedNetworks ( ) const

Returns the names of all managed networks.

Referenced by operator=().

◆ GetManagingNetworkAddress()

const Address * wsf::comm::NetworkManager::GetManagingNetworkAddress ( const Address & aAddress) const

Returns the address of the network that the provided address belongs to.

References wsf::comm::Address::CheckInAddressRange().

Referenced by AddComm(), IsNetworkAddressManaged(), ManageComm(), and operator=().

◆ GetMulticastMembers() [1/2]

NetworkManager::AddressSet wsf::comm::NetworkManager::GetMulticastMembers ( const Address & aMulticastAddress) const

Returns ALL members of a multicast address.

◆ GetMulticastMembers() [2/2]

NetworkManager::AddressSet wsf::comm::NetworkManager::GetMulticastMembers ( const Address & aMulticastAddress,
const std::string & aNetworkName ) const

Returns the members of a network subscribed to a multicast address.

References GetAddressesInNetwork().

Referenced by operator=().

◆ GetNetwork()

Network * wsf::comm::NetworkManager::GetNetwork ( const std::string & aNetworkName) const

◆ GetNetworkNameFromAddress()

std::string wsf::comm::NetworkManager::GetNetworkNameFromAddress ( const Address & aAddress) const

Get name of network associated with an Address.

Referenced by AddComm(), ManageComm(), operator=(), and wsf::comm::UT_DEFINE_SCRIPT_METHOD().

◆ GetReservedAddresses()

const ReservedAddressing & wsf::comm::NetworkManager::GetReservedAddresses ( ) const
inline

Accessor for reserved addressing object.

◆ GetSimulation()

WsfSimulation * wsf::comm::NetworkManager::GetSimulation ( ) const
inline

◆ HasMulticastMember()

bool wsf::comm::NetworkManager::HasMulticastMember ( const Address & aMulticastAddress,
const std::string & aNetworkName ) const

Returns true if the network has a comm subscribed to the provided multicast address.

References GetAddressesInNetwork().

Referenced by operator=().

◆ Initialize()

bool wsf::comm::NetworkManager::Initialize ( )
overridevirtual

Called in response to WsfSimulation::Initialize. This is called to allow the extension to perform any initialization that is required.

Note
The extension should not assume that another extension has been initialized unless it this extension has been registered as a dependency of the other extension.

Initialize reserved addressing

Reimplemented from WsfSimulationExtension.

References AddNetwork(), wsf::comm::reserved::cDEFAULT_INITIAL, Clear(), GetSimulation(), PlatformDeleted(), and WsfObserver::PlatformDeleted().

Referenced by operator=().

◆ InitializeUserLinks()

void wsf::comm::NetworkManager::InitializeUserLinks ( double aSimTime,
Comm * aCommPtr )

If the link being added is between members of the same network, then the network will determine if the link is valid. Otherwise, this is a link between networks, and can be established directly. Note: Currently, this behavior affects all protocols. This could be changed to a protocol by protocol basis in the future, if the need exists.

Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.

Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.

We can use the network manager to find the correct address of the provided platform name + comm name pairs, as this data was already propagated to the network manager during Initialize() calls by the various WsfComm objects.

If the platform name is a null string, then this is a local connection. The name of the platform relevant to this link is the current platform owning this layer's comm.

If the link being added is between members of the same network, then the network will determine if the link is valid. Otherwise, this is a link between network members, and can be established directly.

Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.

Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.

References AddConnection(), wsf::comm::Network::AddLink(), wsf::comm::Address::GetAddress(), wsf::comm::Comm::GetAddress(), GetComm(), wsf::comm::Comm::GetFullName(), wsf::comm::Comm::GetLinkAddresses(), wsf::comm::Comm::GetLinkPairs(), WsfObject::GetName(), wsf::comm::Comm::GetNetwork(), GetNetwork(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByName(), wsf::comm::Comm::GetRouter(), GetSimulation(), and platformPtr.

Referenced by PlatformInitialized(), and PlatformsInitialized().

◆ IsAddressManaged()

bool wsf::comm::NetworkManager::IsAddressManaged ( const Address & aAddress) const

True if Address object present.

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

◆ IsCommManaged()

bool wsf::comm::NetworkManager::IsCommManaged ( Comm * aCommPtr) const

◆ IsMulticastManaged()

bool wsf::comm::NetworkManager::IsMulticastManaged ( const Address & aMulticastAddress) const

True if a multicast address being utilized/managed.

Referenced by operator=().

◆ IsNetworkAddressManaged()

bool wsf::comm::NetworkManager::IsNetworkAddressManaged ( const Address & aAddress) const

True if network address provided overlaps with a currently assigned network address.

References GetManagingNetworkAddress().

Referenced by AddComm(), AddNetwork(), and operator=().

◆ IsNetworkManaged()

bool wsf::comm::NetworkManager::IsNetworkManaged ( const std::string & aNetworkName) const

True if network with name provided present.

References GetNetwork().

Referenced by AddComm(), AddComm(), AddNetwork(), operator=(), and RemoveNetworkConnections().

◆ ManageComm()

void wsf::comm::NetworkManager::ManageComm ( double aSimTime,
Comm * aCommPtr,
const std::string & aNetworkName,
const Address & aAddress,
const Address & aNetworkAddress )

The user didn't specify any addressing or network usage parameters. This comm device will be automatically assigned an address within the "default" network.

Note: We should never reach this branch during normal operating conditions. If this occurs, we need to re-evaluate the number of default comm objects allowed in AFSIM, and perhaps allow it to be defined.

LEGACY SUPPORT Check if the network name is specified to local:master or local:slave and update the value accordingly.

The network name (string) was set. Provide appropriate addressing based on network information.

The network address was set. Create or join a network with that address and assign an appropriate address.

The network associated with this address doesn't exist. Attempt to create it.

Network creation failed.

Network exists. Join it and assign an address.

Address was set. Attempt to assign the comm device to that address, with the resulting network inclusion. If no network exists, one will be made using the address values.

The user defined multiple values for network and/or network assignment, resulting in ambiguous usage. Inform the user and return failure.

References AddComm(), AddNetwork(), wsf::comm::Comm::GetFullName(), GetManagingNetworkAddress(), WsfObject::GetName(), GetNetworkNameFromAddress(), wsf::comm::Address::IsNull(), wsf::comm::util::LocalMasterNetworkName(), and wsf::comm::util::LocalSlaveNetworkName().

Referenced by PlatformInitialized(), and PlatformsInitialized().

◆ operator=() [1/2]

NetworkManager & wsf::comm::NetworkManager::operator= ( const NetworkManager & aSrc)
delete

References NetworkManager().

◆ operator=() [2/2]

◆ PathExists()

bool wsf::comm::NetworkManager::PathExists ( const Address & aSourceAddress,
const Address & aDestinationAddress ) const

Simple check of pathing from source to destination.

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

◆ PendingStart()

void wsf::comm::NetworkManager::PendingStart ( )
overridevirtual

Called in response to a call to WsfSimulation::Initialize complete and pending start state. PendingStart is typically called immediately after the simulation is initialized in the main event loop. The simulation is in its pending start state, although the extension may also add additional platforms. using WsfSimulation::AddPlatform.

Notify callbacks

Reimplemented from WsfSimulationExtension.

References CommFrameworkPendingStart, PlatformInitialized(), and WsfObserver::PlatformInitialized().

Referenced by operator=().

◆ PlatformDeleted()

void wsf::comm::NetworkManager::PlatformDeleted ( double aSimTime,
WsfPlatform * aPlatform )

Notify the observer BEFORE any action is taken.

Inform the router of the interface removal

Find the owning network, and remove the node, if possible.

References WsfComponentList::RoleIterator< T >::AtEnd(), CommFrameworkPlatformDeleted, WsfObserver::CommRemovedFromManager(), WsfPlatform::GetComponents(), and GetNetwork().

Referenced by Initialize().

◆ PlatformInitialized()

void wsf::comm::NetworkManager::PlatformInitialized ( double aSimTime,
WsfPlatform * aPlatform )

◆ PlatformsInitialized()

bool wsf::comm::NetworkManager::PlatformsInitialized ( )
overridevirtual

Called during WsfSimulation::Initialize, via WsfSimulation::AddInputPlatforms(), after all platforms have undergone Initialize() calls. This is called to allow any extension to perform processing that may be predicated on platforms being added to the simulation, with all platforms and components having undergone calls to Initialize(), but prior to calls to Initialize2() having been performed.

Set the router for this comm

Reimplemented from WsfSimulationExtension.

References AddNetwork(), wsf::comm::NetworkTypes::Get(), WsfObjectTypeList< T >::GetCurrentUserTypes(), WsfSimulationExtension::GetScenario(), GetSimulation(), InitializeUserLinks(), ManageComm(), wsf::comm::Network::NamedComm::mCommName, and wsf::comm::Network::NamedComm::mPlatformName.

Referenced by operator=().

◆ RemoveComm() [1/2]

void wsf::comm::NetworkManager::RemoveComm ( double aSimTIme,
Comm * aCommPtr,
bool aNotifyObserver = true )

◆ RemoveComm() [2/2]

void wsf::comm::NetworkManager::RemoveComm ( double aSimTime,
const Address & aAddress,
bool aNotifyObserver = true )

Notify the observer that a node is being removed from the manager

Notify callback

Update the affected comm.

Notify the network losing the comm for internal management.

References CommRemoved, wsf::comm::Address::GetAddress(), GetComm(), GetNetwork(), GetSimulation(), RemoveConnection(), and wsf::comm::Network::RemoveMember().

◆ RemoveConnection() [1/2]

bool wsf::comm::NetworkManager::RemoveConnection ( double aSimTime,
Comm * aSourceCommPtr,
Comm * aDestinationCommPtr,
bool aNotifyObserver = true )

References GetAddress(), and RemoveConnection().

Referenced by RemoveComm(), and RemoveConnection().

◆ RemoveConnection() [2/2]

bool wsf::comm::NetworkManager::RemoveConnection ( double aSimTime,
const Address & aSourceAddress,
const Address & aDestinationAddress,
bool aNotifyObserver = true )

References ConnectionRemoved, and GetComm().

◆ RemoveMulticastMember()

bool wsf::comm::NetworkManager::RemoveMulticastMember ( double aSimTime,
const Address & aMulticastAddress,
const Address & aLeavingMember )

◆ RemoveNetwork()

void wsf::comm::NetworkManager::RemoveNetwork ( double aSimTime,
const std::string & aNetworkName )

Notify the observer of the removed network.

Notify the callback.

References GetAddressesInNetwork(), GetNetwork(), NetworkRemoved, and RemoveComm().

Referenced by AddComm(), and AddComm().

◆ RemoveNetworkConnections()

bool wsf::comm::NetworkManager::RemoveNetworkConnections ( double aSimTime,
const std::string & aNetworkName,
bool aNotifyObserver = true )

Member Data Documentation

◆ CommAdded

UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommAdded {}

Referenced by AddComm(), and AddComm().

◆ CommDisabled

UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommDisabled {}

Referenced by DisableComm().

◆ CommEnabled

UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommEnabled {}

Referenced by EnableComm().

◆ CommFrameworkPendingStart

UtCallbackListN<void()> wsf::comm::NetworkManager::CommFrameworkPendingStart {}

Allows indication that the comm framework is fully set up.

Referenced by PendingStart().

◆ CommFrameworkPlatformDeleted

UtCallbackListN<void(double, WsfPlatform*)> wsf::comm::NetworkManager::CommFrameworkPlatformDeleted {}

Filtered PlatformDeleted event, called prior to the comm framework removing this platform.

Referenced by wsf::comm::router::OSPF_Area::InitializeCallbacks(), and PlatformDeleted().

◆ CommFrameworkPlatformInitialized

UtCallbackListN<void(double, WsfPlatform*)> wsf::comm::NetworkManager::CommFrameworkPlatformInitialized {}

Filtered PlatformInitialized event, called after the comm framework has processed this platform.

Referenced by PlatformInitialized().

◆ CommRemoved

UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommRemoved {}

Referenced by RemoveComm().

◆ ConnectionAdded

UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionAdded {}

Referenced by AddConnection().

◆ ConnectionDisabled

UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionDisabled {}

Referenced by DisableConnection().

◆ ConnectionEnabled

UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionEnabled {}

Referenced by EnableConnection().

◆ ConnectionRemoved

UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionRemoved {}

Referenced by RemoveConnection().

◆ NetworkAdded

UtCallbackListN<void(double, Network*)> wsf::comm::NetworkManager::NetworkAdded {}

Referenced by AddNetwork().

◆ NetworkRemoved

UtCallbackListN<void(double, Network*)> wsf::comm::NetworkManager::NetworkRemoved {}

Referenced by RemoveNetwork().


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