|
WSF
|
#include <WsfComponentList.hpp>

Classes | |
| class | RoleRange |
| class | RoleIterator |
Public Types | |
| using | NameAndComponent = std::pair<WsfStringId, WsfComponent*> |
| using | ComponentList = std::vector<NameAndComponent> |
Public Member Functions | |
| WsfComponentList () | |
| WsfComponentList (const WsfComponentList &aSrc) | |
| WsfComponentList (WsfComponentList &&)=default | |
| virtual | ~WsfComponentList () |
| WsfComponentList & | operator= (const WsfComponentList &aRhs) |
| WsfComponentList & | operator= (WsfComponentList &&) |
| bool | HasComponents () const |
| Returns true if the component list has at least one component. | |
| void | DeleteAllComponents () |
| Delete all of the components maintained by the list. | |
| bool | DeleteComponent (WsfStringId aName, int aRole) |
| unsigned int | GetComponentCount (int aRole) const |
Function templates to make using a component list simpler and more type-safe. | |
These methods can be used if the template type registers its component role using the WSF_DECLARE_COMPONENT_ROLE_TYPE macro. It is a compile-time error to instantiate these templates with a type that has not registered its component role. The header file for the class must be available whenever these classes are used. | |
| ComponentList | mComponentsByName |
| template<class T> | |
| bool | DeleteComponent (WsfStringId aName) |
| template<class T> | |
| bool | DeleteComponent () |
| template<class T> | |
| T * | GetComponent () const |
| template<class T> | |
| T * | GetComponent (WsfStringId aName) const |
| template<class T> | |
| unsigned int | GetComponentCount () const |
| template<class T> | |
| T * | GetComponentEntry (unsigned int aEntry) const |
| template<class T> | |
| bool | FindByRole (T *&aPtr) const |
| template<typename T> | |
| RoleRange< T > | GetComponentRange () |
| virtual void | ComponentAdded (WsfComponent *aComponentPtr) |
| virtual void | ComponentDeleted (WsfComponent *aComponentPtr) |
| bool | AddComponentP (WsfComponent *aComponentPtr, bool aDoNotify) |
| void | CopyAllP (const WsfComponentList &aSrc, bool aDoNotify) |
| Base class implementation of copying a component list. | |
| void | DeleteAllP (bool aDoNotify) |
| Base class implementation of deleting all components in the list. | |
| bool | DeleteComponentP (WsfStringId aName, int aRole, bool aDoNotify) |
| WsfComponent * | FindComponentP (WsfStringId aName, int aRole) const |
| WsfComponent * | FindComponentP (WsfStringId aName) const |
| WsfComponent * | FindComponentByRoleP (int aRole) const |
| WsfComponent * | GetComponentEntryByRoleP (int aRole, unsigned int aEntry) const |
| bool | RemoveComponentP (WsfStringId aName, int aRole, bool aDelete, bool aDoNotify) |
The non-templated base class for a component list. This is provided so there is less code duplication. Much of the list manipulation can be done in a generic matter.
| using WsfComponentList::ComponentList = std::vector<NameAndComponent> |
| using WsfComponentList::NameAndComponent = std::pair<WsfStringId, WsfComponent*> |
| WsfComponentList::WsfComponentList | ( | ) |
Referenced by CopyAllP(), operator=(), operator=(), WsfComponentList::RoleIterator< WsfTaskManagerComponent >::RoleIterator(), WsfComponentList::RoleRange< T >::RoleRange(), WsfComponentList(), WsfComponentList(), WsfComponentListT< WsfComponentT< Comm > >::WsfComponentListT(), and WsfComponentListT< WsfComponentT< Comm > >::WsfComponentListT().
| WsfComponentList::WsfComponentList | ( | const WsfComponentList & | aSrc | ) |
References CopyAllP(), and WsfComponentList().
|
default |
References operator=(), and WsfComponentList().
|
virtual |
References DeleteAllP().
|
protected |
Add a component to the component list. Attempts to add a component to the list of components. The names of components must be unique within their role.
| aComponentPtr | The component to be added. |
| aDoNotify | If true, invoke the ComponentAdded() virtual method to inform the derived class that the component was added. |
References ComponentAdded(), WsfComponent::GetComponentName(), WsfComponent::GetComponentRoles(), and mComponentsByName.
Referenced by WsfComponentListT< WsfComponentT< Comm > >::AddComponent(), and CopyAllP().
|
protectedvirtual |
A virtual method that allows a derived class to know when a entry is being added to the list.
Reimplemented in WsfPlatform.
Referenced by AddComponentP(), and WsfComponentListT< WsfComponentT< Comm > >::SetParentOfComponents().
|
protectedvirtual |
A virtual method that allows a derived class to know when a entry is being delete from the list.
Reimplemented in WsfPlatform.
Referenced by DeleteAllP(), and RemoveComponentP().
|
protected |
Base class implementation of copying a component list.
References AddComponentP(), WsfComponent::CloneComponent(), mComponentsByName, and WsfComponentList().
Referenced by operator=(), WsfComponentListT< WsfComponentT< Comm > >::operator=(), and WsfComponentList().
| void WsfComponentList::DeleteAllComponents | ( | ) |
Delete all of the components maintained by the list.
References DeleteAllP().
Referenced by WsfPlatform::~WsfPlatform().
|
protected |
Base class implementation of deleting all components in the list.
References ComponentDeleted(), and mComponentsByName.
Referenced by DeleteAllComponents(), operator=(), operator=(), WsfComponentListT< WsfComponentT< Comm > >::operator=(), and ~WsfComponentList().
|
inline |
Delete a component with the role implied by the template argument. This is typically used to delete components that are uniquely identified by role. Typical usage:
References DeleteComponent(), and FindComponentByRoleP().
Referenced by WsfPlatform::SetMover().
|
inline |
Delete a component with the specified name and role implied by the template argument. Typical usage:
| aName | The name of the component to be deleted. |
References DeleteComponent().
| bool WsfComponentList::DeleteComponent | ( | WsfStringId | aName, |
| int | aRole ) |
Delete a single component with the specified name and role from the list.
| aName | The name of the component to be deleted. |
| aRole | The primary role of the component to be deleted. |
References DeleteComponentP().
Referenced by WsfExtEmission::AddSensor(), WsfMilExtInterface::AddWeapon(), wsf::six_dof::Mover::CommonSubobjectJettisonTasks(), WsfP6DOF_Mover::CommonSubobjectJettisonTasks(), DeleteComponent(), DeleteComponent(), WsfObjectTypeListBase::DeleteComponentP(), WsfZoneTypes::LoadInstance(), WsfDisDirectedEnergyFire::Process(), WsfExtInterface::StripExternalPlatform(), and WsfDisWeaponEvents::TransferPlatformToExternalControl().
|
protected |
References RemoveComponentP().
Referenced by DeleteComponent().
|
inline |
Find a component with the specified role. This should be used only to access components that are uniquely identified by their role. Typical usage:
References mComponentsByName.
Referenced by wsf::altloc::Component::Find(), wsf::comm::ComponentHW::Find(), wsf::comm::ComponentHW_JTIDS::Find(), wsf::comm::ComponentHW_LASER::Find(), wsf::comm::ComponentHW_Subsurface::Find(), wsf::xio::CommComponent::Find(), WsfBrawlerProcessor::Find(), WsfChaffParcel::Find(), WsfCTD_SensorComponent::Find(), WsfEW_CommComponent::Find(), WsfEW_RcvrComponent::Find(), WsfEW_Result::Find(), WsfEW_SensorComponent::Find(), WsfEW_XmtrComponent::Find(), WsfExclusionSensorComponent::Find(), WsfLaunchHandoffData::Find(), WsfMilDisInterface::Find(), WsfMilDisPlatform::Find(), WsfMilExtInterface::Find(), WsfMoonLOS_SensorComponent::Find(), WsfMultiresolutionPlatformComponent< DerivedComponent >::Find(), WsfSolarElevationAtTargetSensorComponent::Find(), WsfSolarIlluminationComponent::Find(), WsfTRIMSIM_SensorComponent::Find(), WsfWeaponPlatformExtension::Find(), and WsfWeaponTaskManager::Find().
|
protected |
References mComponentsByName.
Referenced by DeleteComponent(), WsfComponentListT< WsfComponentT< Comm > >::FindComponentByRole(), and GetComponent().
|
protected |
References mComponentsByName.
|
protected |
Find the first component with the specified name and role. Remember that components are guaranteed to have unique names only within a primary role. If a non-primary role is specified then multiple components may have the same name and only the first one will be located.
| aName | The name of the desired component. |
| aRole | The role of the desired component. |
References WsfComponent::ComponentHasRole(), and mComponentsByName.
Referenced by WsfComponentListT< WsfComponentT< Comm > >::FindComponent(), WsfComponentListT< WsfComponentT< Comm > >::FindComponent(), and GetComponent().
|
inline |
Get a component with the role implied by the template argument This method can be used to return the component with the role implied by the template argument. In general this should be used to retrieve a component where it is known that at most one instance having the specified role exist with the list. If it is used then it will return the first entry with the given role. Typical usage:
References FindComponentByRoleP().
Referenced by WsfWeapon::ActiveWeaponPlatformsFor(), WsfDisArticulatedPartList::AddArticulatedParts(), WsfTaskManager::AssignTask(), WsfWeaponTaskManager::AssignTask(), WsfBeamDirector::WsfBeamDirectorMode::AttemptToDetect(), wsf::comm::ComponentHW_LASER::CanSendTo(), checkDownCommandChain(), checkDownCommandChain(), checkUpCommandChain(), checkUpCommandChain(), WsfL16::SystemStatusPart::CheckWeapon(), WsfRIPRProcessor::CommanderPlatform(), WsfRIPRProcessor::CommanderProcessor(), WsfConfigureAccessReport::Complete(), wsf::cyber::Engagement::Draw(), WsfScriptCallback::Execute(), WsfCallback::ExecuteAndNotify(), wsf::comm::ProtocolIGMP::Find(), wsf::comm::router::ProtocolAdHoc::Find(), wsf::comm::router::ProtocolLegacy::Find(), wsf::comm::router::ProtocolMulticast::Find(), wsf::comm::router::ProtocolOSPF::Find(), WsfXIO_WeaponComponent::FindPart(), SafeRIPRProc::get(), getAllPartsDownCommandChain(), WsfBMUtils::GetCommander(), getManagingSensorsManager(), SafeRIPRProc::GetName(), WsfFalseTargetBlip::GetReferenceJammerToRadarRange(), getTopCommander(), WsfUplinkProcessor::GetUplinkCommForTrack(), WsfBMUtils::GetWeapon(), WsfBMUtils::GetWeaponID(), WsfWeaponEngagement::GetWeaponSystem(), WsfXIO_WeaponComponent::HandleStateChangeRequest(), wsf::comm::router::ProtocolOSPF::Initialize(), WsfCompositeSensor::Initialize(), WsfExchange::Transactor::Initialize(), WsfL16::ComputerPart::Initialize(), WsfL16::SurveillancePart::Initialize(), WsfScriptCallback::Initialize(), WsfWeaponTrackProcessor::Initialize(), WsfGuidedMoverBase::Initialize2(), WsfTaskManager::Initialize2(), WsfExplicitWeapon::InitializeCommandChains(), WsfIterativeRouteMover::IsWaypointSwitchTime(), WsfXIO_ObjectInfoLoad::Load_Platform(), wsf::comm::util::LocalSlaveNetworkName(), WsfMessageProcessor::Selector::Matches(), WsfCommandChain::PlatformAdded(), wsf::comm::NetworkManager::PlatformInitialized(), WsfCompositeSensor::ProcessMessage(), WsfTrackProcessor::ProcessMessage(), Fires::DisObserver::ProcessPDU(), WsfWeapon::RoundsCompleteFor(), WsfWeapon::RoundsFiredAt(), wsf::comm::router::ProtocolOSPF::Routing(), WsfWeapon::SalvosFiredAt(), WsfL16::SystemStatusPart::SendAirSystemStatus(), WsfPlatformPart::SendMessageToProcessor(), WsfTaskManager::SendTaskMessage(), WsfWeaponServer::SetCommander(), WsfExplicitWeapon::SetLaunchState(), WsfUplinkProcessor::StartUplinking(), WsfRIPRProcessor::SubordinatePlatforms(), WsfRIPRProcessor::SubordinateProcessors(), WsfRIPRProcessor::Subordinates(), WsfRIPRProcessor::SubsTargeting(), WsfRIPRProcessor::SubsWeaponsActive(), WsfWeaponTaskManager::TaskCanceled(), WsfWeapon::TimeWeaponLastFiredFor(), WsfWeapon::TimeWeaponLastTerminatedFor(), WsfPerceptionProcessor::TruthAssets(), WsfSA_Perceive::TruthAssets(), WsfHighEnergyLaser::UpdateEngagementGeometry(), WsfEventPipeInterface::UpdatePartArticulation(), WsfWeaponTaskManager::UplinkStart(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), WsfL16::SystemStatusPart::WeaponQuantity(), WsfWeapon::WeaponsActiveAndPendingFor(), WsfWeapon::WeaponsActiveFor(), and WsfWeapon::WeaponsPendingFor().
|
inline |
Get a component with the specified name and role implied by the template argument Typical usage:
References FindComponentP().
|
inline |
Return the number of components of a particular component role. Typical usage:
References GetComponentCount().
| unsigned int WsfComponentList::GetComponentCount | ( | int | aRole | ) | const |
Get the count of components with the specified role.
| aRole | The role whose component count is being requested. |
References mComponentsByName.
Referenced by WsfSA_Processor::CalculateEmissions(), checkDownCommandChain(), checkDownCommandChain(), checkFullCommandChain(), checkFullCommandChain(), checkUpCommandChain(), checkUpCommandChain(), WsfConfigureAccessReport::Complete(), WsfWeapon::DetermineFirepowerStatus(), FlightPathAnalysisFunction::Execute(), findWMAI(), getAllPartsDownCommandChain(), getAllPartsDownCommandChain(), GetComponentCount(), WsfBMUtils::GetRawTrackSensorType(), WsfBMUtils::GetSensor(), WsfBMUtils::GetSensorID(), WsfBMUtils::GetSensorID(), WsfCompositeSensor::GetSensorIndex(), WsfChaffWeapon::Initialize(), isC2CapableHelper(), WsfDisPlatform::MessageReceived(), WsfL16::SystemStatusPart::SendLandPointSystemStatus(), WsfBMDisseminateC2::SendMessage(), WsfSA_Perceive::TruthAssets(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
inline |
Return the component with the specified index with the list of components of a component role. Typical usage:
References GetComponentEntryByRoleP().
Referenced by WsfSA_Processor::CalculateEmissions(), WsfInterceptCalculator::CanIntercept(), checkDownCommandChain(), checkDownCommandChain(), checkFullCommandChain(), checkFullCommandChain(), checkUpCommandChain(), checkUpCommandChain(), findWMAI(), getAllPartsDownCommandChain(), getAllPartsDownCommandChain(), WsfBMUtils::GetRawTrackSensorType(), WsfBMUtils::GetSensor(), WsfBMUtils::GetSensor(), WsfBMUtils::GetSensorID(), WsfBMUtils::GetSensorID(), WsfChaffWeapon::Initialize(), WsfDefaultAssetManagerImpl::Initialize2(), WsfDefaultDisseminationImpl::Initialize2(), isC2CapableHelper(), WsfDisPlatform::MessageReceived(), WsfBMDisseminateC2::SendMessage(), WsfBrawlerProcessor::SensorGimbalAzimuthLimit(), WsfBrawlerProcessor::SensorGimbalElevationLimit(), WsfSA_Perceive::TruthAssets(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
protected |
References mComponentsByName.
Referenced by GetComponentEntry(), and WsfComponentListT< WsfComponentT< Comm > >::GetComponentEntryByRole().
|
inline |
Yields a range that lets you loop over every component of a given type. Usage:
| T | The type of the components to loop over. |
|
inline |
Returns true if the component list has at least one component.
References mComponentsByName.
Referenced by WsfSensorComponent::AttemptToDetect(), WsfSensorComponent::ComputeMeasurementErrors(), WsfSensorComponent::ComputeSphericalMeasurementErrors(), WsfSensorComponent::PostAttemptToDetect(), WsfSensorComponent::PostPerformScheduledDetections(), WsfSensorComponent::PrePerformScheduledDetections(), WsfSensorBeam::ProcessInput(), WsfSensorMode::ProcessInput(), and WsfSensorComponent::UpdateTrack().
| WsfComponentList & WsfComponentList::operator= | ( | const WsfComponentList & | aRhs | ) |
References CopyAllP(), DeleteAllP(), and WsfComponentList().
Referenced by WsfComponentListT< WsfComponentT< Comm > >::operator=(), and WsfComponentList().
| WsfComponentList & WsfComponentList::operator= | ( | WsfComponentList && | aRhs | ) |
References DeleteAllP(), mComponentsByName, and WsfComponentList().
|
protected |
References ComponentDeleted(), WsfComponent::ComponentHasRole(), and mComponentsByName.
Referenced by DeleteComponentP(), and WsfComponentListT< WsfComponentT< Comm > >::RemoveComponent().
|
protected |
Referenced by AddComponentP(), WsfComponentListT< WsfComponentT< Comm > >::Begin(), CopyAllP(), DeleteAllP(), WsfComponentListT< WsfComponentT< Comm > >::End(), FindByRole(), FindComponentByRoleP(), FindComponentP(), FindComponentP(), GetComponentCount(), GetComponentEntryByRoleP(), WsfComponentListT< WsfComponentT< Comm > >::GetComponentsByInitializationOrder(), HasComponents(), operator=(), RemoveComponentP(), WsfComponentList::RoleIterator< WsfTaskManagerComponent >::RoleIterator(), and WsfComponentListT< WsfComponentT< Comm > >::SetParentOfComponents().