WSF
WsfObjectTypeList< T > Class Template Reference

#include <WsfObjectTypeList.hpp>

Inheritance diagram for WsfObjectTypeList< T >:
Collaboration diagram for WsfObjectTypeList< T >:

Classes

struct  LoadResult
 Result of a LoadType() operation. More...

Public Types

typedef T ObjectType
typedef std::vector< T * > ObjectPtrList
Public Types inherited from WsfObjectTypeListBase
enum  Flags {
  cREDEFINITION_ALLOWED = 1 , cSINGULAR_BASE_TYPE = 2 , cOBJECT_FACTORY_BASE = 4 , cNO_DELAY_LOAD = 8 ,
  cSIGNATURE_FLAGS = cREDEFINITION_ALLOWED | cNO_DELAY_LOAD
}
Public Types inherited from WsfObjectTypeListBaseI
typedef std::vector< WsfStringIdTypeIdList

Public Member Functions

 WsfObjectTypeList (WsfScenario &aScenario, unsigned int aFlags, const std::string &aBlockName)
 WsfObjectTypeList (WsfScenario &aScenario, const std::string &aBlockName)
bool Add (WsfStringId aId, std::unique_ptr< T > aDefinitionPtr)
bool AddCoreType (WsfStringId aId, std::unique_ptr< T > aDefinitionPtr)
T * Clone (WsfStringId aId) const override
T * Find (WsfStringId aId) const override
ObjectPtrList GetCoreTypes () const
 Returns a list of core types, i.e. types added via AddCoreType.
void GetCurrentTypes (ObjectPtrList &aListOfPtrs) const
void GetCurrentUserTypes (ObjectPtrList &aListOfPtrs) const
 Returns the list of types defined by the user (no core / builtin types).
bool IsType (WsfStringId aTypeName) const
void SetSingularBaseType ()
template<typename FACTORY_LIST>
void SetObjectFactory (const FACTORY_LIST *aFactoryListPtr)
template<typename DEFAULT_TYPE>
void SetObjectFactoryDefault ()
virtual LoadResult LoadType (UtInput &aInput)
bool ProcessInput (UtInput &aInput) override
virtual bool InitializeType (ObjectType *aTypePtr)
Public Member Functions inherited from WsfObjectTypeListBase
 WsfObjectTypeListBase (const WsfObjectTypeListBase &)=delete
WsfObjectTypeListBaseoperator= (const WsfObjectTypeListBase &)=delete
 WsfObjectTypeListBase (unsigned int aFlags, const std::string &aBlockName=std::string(), WsfScenario *aScenarioPtr=nullptr)
 ~WsfObjectTypeListBase () override
void Clear () override
 Clear (Erase) all type entries.
void GetTypeIds (TypeIdList &aListOfIds) const override
 Return a vector of the type identifiers currently being controlled by this list.
bool ProcessInput (UtInput &aInput) override
int Size () const
 Return the current number of types being maintained by the list.
const std::string & GetBlockName () const override
WsfScenarioGetScenario () const
Public Member Functions inherited from WsfObjectTypeListBaseI
virtual ~WsfObjectTypeListBaseI ()=default
virtual void CompleteLoad ()

Static Protected Member Functions

template<typename DEFAULT_TYPE>
static WsfObjectCreateDefaultFunction ()
static WsfObjectCreateFunction ()
template<typename FACTORY_LIST>
static WsfObjectFactoryCreateFunction (void *aListPtr, const std::string &aTypeName)

Helper methods for components that utilize type lists.

These are invoked from the component factories to facilitate the adding, editing and deleting of component instances on platforms.

bool LoadNamedComponent (UtInput &aInput, WsfPlatform &aPlatform, bool aIsAdding, int aRole)
bool LoadUnnamedComponent (UtInput &aInput, WsfPlatform &aPlatform, bool aIsAdding, int aRole)
bool LoadUnnamedComponentWithoutEdit (UtInput &aInput, WsfPlatform &aPlatform, bool aIsAdding, int aRole)
bool DeleteNamedComponent (UtInput &aInput, WsfPlatform &aPlatform, int aRole)
bool DeleteUnnamedComponent (UtInput &aInput, WsfPlatform &aPlatform, int aRole)
bool InitializeTypeP (WsfObject *aObjectPtr) override

Additional Inherited Members

Protected Types inherited from WsfObjectTypeListBase
typedef std::map< WsfStringId, std::unique_ptr< WsfObject > > TypeMap
Protected Member Functions inherited from WsfObjectTypeListBase
WsfDeferredInputGetDeferredInput () const
bool CanDelayLoad () const
bool AddP (WsfStringId aId, std::unique_ptr< WsfObject > aDefinitionPtr)
WsfObjectCloneP (WsfStringId aId) const
virtual WsfObjectFindP (WsfStringId aId) const
bool LoadTypeP (UtInput &aInput, WsfObject *&aLoadedObjectPtr)
virtual bool DeferredLoadTypeP (UtInput &aInput, WsfObject *&aLoadedObjectPtr)
bool DeleteComponentP (UtInput &aInput, WsfPlatform &aPlatform, int aRole, bool aIsNamed)
bool LoadComponentP (UtInput &aInput, WsfPlatform &aPlatform, bool aIsAdding, int aRole, bool aIsNamed, bool aIsEditable)
Protected Attributes inherited from WsfObjectTypeListBase
TypeMap mTypeMap
std::vector< std::unique_ptr< WsfObject > > mRedefinedTypes
 A list of type objects that have been redefined.
std::set< WsfStringIdmCoreTypes
unsigned int mFlags
const std::string mBlockName
WsfObject *(* mCreateSingularTypeFunction )()
WsfObject *(* mFactoryCreateFunction )(void *aListPtr, const std::string &aTypeName)
WsfObject *(* mFactoryCreateDefault )()
void * mFactoryPtr
WsfScenariomScenarioPtr

Detailed Description

template<class T>
class WsfObjectTypeList< T >

A template class for defining a list of 'type' objects.

A 'type' object is one that can be cloned to create specific 'instances' of the type. For instance, a 'platform_type' of 'Honda_Civic' can be created added to a 'platform_type' list. Instances of 'Honda_Civic' can then cloned and added to the simulation.

Each class the supports object types instantiates one of these. The user or the input factories can populate these type lists and instantiate objects from them.

Member Typedef Documentation

◆ ObjectPtrList

template<class T>
typedef std::vector<T*> WsfObjectTypeList< T >::ObjectPtrList

◆ ObjectType

template<class T>
typedef T WsfObjectTypeList< T >::ObjectType

Constructor & Destructor Documentation

◆ WsfObjectTypeList() [1/2]

template<class T>
WsfObjectTypeList< T >::WsfObjectTypeList ( WsfScenario & aScenario,
unsigned int aFlags,
const std::string & aBlockName )
inline

◆ WsfObjectTypeList() [2/2]

template<class T>
WsfObjectTypeList< T >::WsfObjectTypeList ( WsfScenario & aScenario,
const std::string & aBlockName )
inline

Member Function Documentation

◆ Add()

template<class T>
bool WsfObjectTypeList< T >::Add ( WsfStringId aId,
std::unique_ptr< T > aDefinitionPtr )
inline

Add a new type with the given name.

The return value will be 'true' if the type was successfully added and 'false' if not (i.e.: it attempts to duplicate a type that already exists. This will take ownership of aDefinitionPtr.

Referenced by Fires::FiresTables::AddedToScenario(), wsf::six_dof::TypeManager::AddedToScenario(), WsfAirCombatTypeManager::AddedToScenario(), WsfP6DOF_TypeManager::AddedToScenario(), WsfSpaceExtension::AddedToScenario(), WsfMilExtInterface::CompleteLoad(), WsfThermalSystem::ProcessInput(), StubInterface::StubInterface(), WsfL16_Extension::WsfL16_Extension(), and WsfRIPR_ModuleSetup::WsfRIPR_ModuleSetup().

◆ AddCoreType()

template<class T>
bool WsfObjectTypeList< T >::AddCoreType ( WsfStringId aId,
std::unique_ptr< T > aDefinitionPtr )
inline

Add a new core type with the given name. Core types are defined by C++ code, and cannot be overwritten.

The return value will be 'true' if the type was successfully added and 'false' if no (i.e.: it attempts to duplicate a type that already exists). This takes ownership of the aDefinitionPtr.

Referenced by IADSC2ScenarioExtension::AddedToScenario(), WsfBrawler::AddedToScenario(), WsfMilExtension::AddedToScenario(), WsfSOSM_Interface::AddedToScenario(), WsfMilCommTypes::Register(), and WsfMilSensorTypes::Register().

◆ Clone()

◆ CreateDefaultFunction()

template<class T>
template<typename DEFAULT_TYPE>
WsfObject * WsfObjectTypeList< T >::CreateDefaultFunction ( )
inlinestaticprotected

◆ CreateFunction()

template<class T>
WsfObject * WsfObjectTypeList< T >::CreateFunction ( )
inlinestaticprotected

◆ DeleteNamedComponent()

template<class T>
bool WsfObjectTypeList< T >::DeleteNamedComponent ( UtInput & aInput,
WsfPlatform & aPlatform,
int aRole )
inline

◆ DeleteUnnamedComponent()

template<class T>
bool WsfObjectTypeList< T >::DeleteUnnamedComponent ( UtInput & aInput,
WsfPlatform & aPlatform,
int aRole )
inline

◆ FactoryCreateFunction()

template<class T>
template<typename FACTORY_LIST>
WsfObject * WsfObjectTypeList< T >::FactoryCreateFunction ( void * aListPtr,
const std::string & aTypeName )
inlinestaticprotected

◆ Find()

template<class T>
T * WsfObjectTypeList< T >::Find ( WsfStringId aId) const
inlineoverridevirtual

Return the definition of the given type. The return value will be zero if the requested type is not present.

Implements WsfObjectTypeListBase.

Referenced by WsfMilExtInterface::CompleteLoad(), WsfOrbitalEvent::Create(), WsfRoadMover::CreateRoute(), AntennaPlotFunction::Execute(), WsfXIO_PlatformInfoService::FindObjectType(), WsfXIO_WeaponComponent::FindPartType(), WsfArticulatedPart::Initialize(), WsfEW_FalseTargetEffect::FT_Data::Initialize(), WsfZoneAttenuation::Initialize(), WsfZoneReference::Initialize(), XWsfRouteNetwork::Initialize(), wsf::coverage::ZoneBasedGrid::InitializeP(), WsfP6DOF_Mover::InitializeSubobject(), WsfObjectTypeList< SensorErrorModelBase >::IsType(), WsfPlatformAvailability::PlatformIsAvailable(), wsf::coverage::RectangularGrid::PreparePlatforms(), wsf::coverage::ZoneBasedGrid::PreparePlatforms(), WsfMilExtInterface::PrintEmitterTypes(), WsfDisDirectedEnergyFire::Process(), wsf::coverage::CompositeGrid::ProcessInput(), wsf::coverage::Coverage::ProcessInput(), wsf::coverage::Measure::ProcessInput(), wsf::coverage::SimulationExtension::ProcessInput(), wsf::space::AtmosphereSimulationExtension::ProcessInput(), WsfEW_FalseTargetEffect::FT_Data::ProcessInput(), WsfEW_SLB_Effect::ProcessInput(), WsfEW_SLC_Effect::ProcessInput(), WsfIntegratingPropagator::ProcessInput(), WsfOrbitalDynamics::ProcessInput(), WsfPathFinder::ProcessInput(), WsfSpaceMoverBase::ProcessInput(), WsfThermalSystemComponent::ProcessInput(), wsf::AtmosphericTurbulence::SetCN2Form(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), WsfExtData::WriteEmitterTypes(), and WsfExtData::WriteEntityTypes().

◆ GetCoreTypes()

template<class T>
ObjectPtrList WsfObjectTypeList< T >::GetCoreTypes ( ) const
inline

Returns a list of core types, i.e. types added via AddCoreType.

◆ GetCurrentTypes()

template<class T>
void WsfObjectTypeList< T >::GetCurrentTypes ( ObjectPtrList & aListOfPtrs) const
inline

◆ GetCurrentUserTypes()

template<class T>
void WsfObjectTypeList< T >::GetCurrentUserTypes ( ObjectPtrList & aListOfPtrs) const
inline

Returns the list of types defined by the user (no core / builtin types).

Referenced by WsfZoneAttenuation::Initialize(), and wsf::comm::NetworkManager::PlatformsInitialized().

◆ InitializeType()

◆ InitializeTypeP()

template<class T>
bool WsfObjectTypeList< T >::InitializeTypeP ( WsfObject * aObjectPtr)
inlineoverrideprotectedvirtual

Implements WsfObjectTypeListBase.

◆ IsType()

template<class T>
bool WsfObjectTypeList< T >::IsType ( WsfStringId aTypeName) const
inline

◆ LoadNamedComponent()

template<class T>
bool WsfObjectTypeList< T >::LoadNamedComponent ( UtInput & aInput,
WsfPlatform & aPlatform,
bool aIsAdding,
int aRole )
inline

◆ LoadType()

template<class T>
virtual LoadResult WsfObjectTypeList< T >::LoadType ( UtInput & aInput)
inlinevirtual

Load a new 'type object' from an input stream. Process the current command if it is one that defines a new 'type object' of this class.

Parameters
aInputThe input stream.
Exceptions
UtInput::ExceptionBase(or derived class) if an error was encountered.

Reimplemented in WsfAdvancedBehaviorTreeNodeTypes, WsfBehaviorTreeNodeTypes, WsfCallbackTypes, WsfEM_AttenuationTypes, WsfEM_ClutterTypes, WsfEM_PropagationTypes, WsfGroupTypes, WsfPlatformTypes, WsfSensorErrorModelTypes, and WsfZoneTypes.

Referenced by WsfGroupTypes::LoadType(), WsfObjectTypeList< SensorErrorModelBase >::ProcessInput(), and ATA_LaunchComputerGenerator::WriteOutputFile().

◆ LoadUnnamedComponent()

template<class T>
bool WsfObjectTypeList< T >::LoadUnnamedComponent ( UtInput & aInput,
WsfPlatform & aPlatform,
bool aIsAdding,
int aRole )
inline

◆ LoadUnnamedComponentWithoutEdit()

template<class T>
bool WsfObjectTypeList< T >::LoadUnnamedComponentWithoutEdit ( UtInput & aInput,
WsfPlatform & aPlatform,
bool aIsAdding,
int aRole )
inline

◆ ProcessInput()

template<class T>
bool WsfObjectTypeList< T >::ProcessInput ( UtInput & aInput)
inlineoverridevirtual

◆ SetObjectFactory()

template<class T>
template<typename FACTORY_LIST>
void WsfObjectTypeList< T >::SetObjectFactory ( const FACTORY_LIST * aFactoryListPtr)
inline

◆ SetObjectFactoryDefault()

template<class T>
template<typename DEFAULT_TYPE>
void WsfObjectTypeList< T >::SetObjectFactoryDefault ( )
inline

◆ SetSingularBaseType()

template<class T>
void WsfObjectTypeList< T >::SetSingularBaseType ( )
inline

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