12#ifndef WSFCOMMNETWORK_HPP
13#define WSFCOMMNETWORK_HPP
16#include <unordered_map>
19#include "UtScriptClassDefine.hpp"
23#include "wsf_export.h"
108 bool AddLink(
const Address& aSourceAddress,
109 const Address& aDestinationAddress,
112 bool RemoveLink(
const Address& aSourceAddress,
113 const Address& aDestinationAddress,
154 bool HasMember(
const Address& aAddress)
const;
164 virtual bool ProcessAddressListInput(UtInput& aInput);
165 virtual bool ProcessAddressLinkListInput(UtInput& aInput);
166 virtual bool ProcessNamedListInput(UtInput& aInput);
167 virtual bool ProcessNamedLinkListInput(UtInput& aInput);
192 const Address& aDestinationAddress,
199 const Address& aDestinationAddress,
238 std::string
ToString(
void* aObjectPtr)
const override;
271 static_assert(std::is_base_of<wsf::comm::Network, T>::value,
"Template type must derive from wsf::comm::Network");
272 auto network =
static_cast<T*
>(aNetworkPtr);
273 if (!network->IsManaged())
289struct hash<
wsf::comm::Network::NamedComm>
wsf::comm::Address Address
Definition WsfScriptCommRouterClass.cpp:29
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfCommAddress.hpp:57
Definition WsfCommNetwork.hpp:51
AddressLinkList mAddressLinkList
Definition WsfCommNetwork.hpp:215
virtual bool AddLinkP(const Address &aSourceAddress, const Address &aDestinationAddress, WsfSimulation &aSimulation, const Address &aOptionalAddress=Address())
Definition WsfCommNetwork.hpp:191
AddressList mInputAddressList
Definition WsfCommNetwork.hpp:214
Network(const Network &aSrc)=default
NamedLinkList mNamedLinkList
Definition WsfCommNetwork.hpp:224
void SetAddress(const Address &aAddress)
Definition WsfCommNetwork.hpp:126
AddressList mAddressList
Definition WsfCommNetwork.hpp:208
bool mManaged
True if this network is being managed by the simulation.
Definition WsfCommNetwork.hpp:227
virtual bool Initialize(WsfSimulation &aSim)
Definition WsfCommNetwork.hpp:96
std::vector< std::pair< Address, Address > > AddressLinkList
Definition WsfCommNetwork.hpp:72
std::vector< NamedComm > NamedList
Definition WsfCommNetwork.hpp:73
virtual bool RemoveLinkP(const Address &aSourceAddress, const Address &aDestinationAddress, WsfSimulation &aSimulation, const Address &aOptionalAddress=Address())
Definition WsfCommNetwork.hpp:198
Network * Clone() const override
Definition WsfCommNetwork.hpp:94
NamedList mNamedList
Definition WsfCommNetwork.hpp:223
virtual bool AddMemberP(const Address &aAddress, WsfSimulation &aSimulation, const Address &aOptionalAddress=Address())
Definition WsfCommNetwork.hpp:181
std::vector< Address > AddressList
Definition WsfCommNetwork.hpp:71
const NamedList & GetNamedMemberList() const
Definition WsfCommNetwork.hpp:149
const Address & GetAddress() const
Definition WsfCommNetwork.hpp:129
AddressLinkList mInputAddressLinkList
Same case as "mInputAddressList" above, except with link definitions.
Definition WsfCommNetwork.hpp:218
Network(Network &&aSrc)=default
const char * GetScriptClassName() const override
virtual bool InitializeLinkageP(WsfSimulation &aSimulation)
Definition WsfCommNetwork.hpp:157
bool InitializeLinkage(WsfSimulation &aSimulation)
Definition WsfCommNetwork.cpp:66
Address mAddress
Definition WsfCommNetwork.hpp:207
void SetIsManaged(bool aManaged)
Definition WsfCommNetwork.hpp:127
size_t GetHostsMax() const
Definition WsfCommNetwork.hpp:130
bool ProcessInput(UtInput &aInput) override
Definition WsfCommNetwork.hpp:93
virtual bool RemoveMemberP(const Address &aAddress, WsfSimulation &aSimulation, const Address &aOptionalAddress=Address())
Definition WsfCommNetwork.hpp:185
std::vector< std::pair< NamedComm, NamedComm > > NamedLinkList
Definition WsfCommNetwork.hpp:74
Network & operator=(const Network &aRhs)=default
bool IsManaged() const
Definition WsfCommNetwork.hpp:131
~Network() override=default
UT_DECLARE_SCRIPT_METHOD(RemoveMember_1)
static void DestroyHelper(void *aNetworkPtr)
Definition WsfCommNetwork.hpp:269
UT_DECLARE_SCRIPT_METHOD(RemoveLink_1)
UT_DECLARE_SCRIPT_METHOD(GetNetwork_1)
UT_DECLARE_SCRIPT_METHOD(GetNetwork_2)
UT_DECLARE_SCRIPT_METHOD(RemoveMember_2)
UT_DECLARE_SCRIPT_METHOD(AddLink_1)
UT_DECLARE_SCRIPT_METHOD(AddLink_2)
UT_DECLARE_SCRIPT_METHOD(GetManagedNetworks)
UT_DECLARE_SCRIPT_METHOD(SetName)
ScriptNetworkClass(const std::string &aClassName, UtScriptTypes *aTypesPtr)
Definition WsfCommNetwork.cpp:391
UT_DECLARE_SCRIPT_METHOD(SetAddress)
UT_DECLARE_SCRIPT_METHOD(GetMembers)
UT_DECLARE_SCRIPT_METHOD(AddNetwork)
UT_DECLARE_SCRIPT_METHOD(GetAddress)
UT_DECLARE_SCRIPT_METHOD(RemoveLink_2)
std::string ToString(void *aObjectPtr) const override
Definition WsfCommNetwork.cpp:424
UT_DECLARE_SCRIPT_METHOD(AddMember_1)
UT_DECLARE_SCRIPT_METHOD(RemoveNetwork)
UT_DECLARE_SCRIPT_METHOD(AddMember_2)
UT_DECLARE_SCRIPT_METHOD(GetName)
Template specialization for wsf::comm::Address. Allows usage of Address in std::unordered_map/set.
Definition WsfCommAddress.hpp:185
Definition WsfComm.cpp:34
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
size_t operator()(const wsf::comm::Network::NamedComm &aComm) const
Definition WsfCommNetwork.hpp:291
Definition WsfCommNetwork.hpp:54
WsfStringId mCommName
Definition WsfCommNetwork.hpp:56
bool operator==(const NamedComm &aComm) const
Definition WsfCommNetwork.hpp:63
bool operator!=(const NamedComm &aComm) const
Definition WsfCommNetwork.hpp:68
NamedComm(WsfStringId aPlatformName, WsfStringId aCommName)
Definition WsfCommNetwork.hpp:59
WsfStringId mPlatformName
Definition WsfCommNetwork.hpp:55