WSF
WsfComponentFactoryList< PARENT_TYPE > Class Template Reference

#include <WsfComponentFactoryList.hpp>

Classes

class  Iterator

Public Types

typedef std::vector< std::unique_ptr< WsfComponentFactoryBase > > FactoryList
typedef WsfComponentFactory< PARENT_TYPE > FactoryType

Iterative calls to the methods in WsfComponentFactory.

See WsfComponentFactory for specific methods.

static void PreInput (const WsfScenario &aScenario, PARENT_TYPE &aParent)
static bool ProcessInput (const WsfScenario &aScenario, UtInput &aInput, PARENT_TYPE &aParent)
static bool ProcessAddOrEditCommand (const WsfScenario &aScenario, UtInput &aInput, PARENT_TYPE &aParent, bool aIsAdding)
static void ProcessDeleteCommand (const WsfScenario &aScenario, UtInput &aInput, PARENT_TYPE &aParent)
static bool PreInitialize (const WsfScenario &aScenario, double aSimTime, PARENT_TYPE &aParent)

Detailed Description

template<typename PARENT_TYPE>
class WsfComponentFactoryList< PARENT_TYPE >

A templated class to simplify the use of component factories.

The component factory list can contain factories that apply to different parent classes. It always contains factories for those components that are part of WsfPlatform, but it may also include factories for other types of parent classes, e.g. WsfProcessor. This class contains static methods which parallel one-for-one the virtual methods in WsfComponentFactory. The static methods iterate over the component factory list and invoke only the factories that pertain to the class of the invoker.

For instance, to invoke the PreInitialize method of the factories that pertain only to WsfPlatform, WsfPlatform might do the following:

bool ok = WsfComponentFactoryList<WsfPlatform>::PreInitialize(GetScenario(), aSimTime, *this);
bool ok
Definition WsfScriptWeaponClass.cpp:211
static bool PreInitialize(const WsfScenario &aScenario, double aSimTime, PARENT_TYPE &aParent)
Definition WsfComponentFactoryList.hpp:162

While WsfProcessor would do the following:

bool ok = WsfComponentFactoryList<WsfProcessor>::PreInitialize(GetScenario(), aSimTime, *this);

The static methods will iterate over the factory list and invoke ONLY those factories that pertain to the invoker.

NOTE: This is NOT meant to be included in another header file. It is pretty heavy and requires the user to include the following header files.

Member Typedef Documentation

◆ FactoryList

template<typename PARENT_TYPE>
typedef std::vector<std::unique_ptr<WsfComponentFactoryBase> > WsfComponentFactoryList< PARENT_TYPE >::FactoryList

◆ FactoryType

template<typename PARENT_TYPE>
typedef WsfComponentFactory<PARENT_TYPE> WsfComponentFactoryList< PARENT_TYPE >::FactoryType

Member Function Documentation

◆ PreInitialize()

◆ PreInput()

template<typename PARENT_TYPE>
void WsfComponentFactoryList< PARENT_TYPE >::PreInput ( const WsfScenario & aScenario,
PARENT_TYPE & aParent )
inlinestatic

◆ ProcessAddOrEditCommand()

template<typename PARENT_TYPE>
bool WsfComponentFactoryList< PARENT_TYPE >::ProcessAddOrEditCommand ( const WsfScenario & aScenario,
UtInput & aInput,
PARENT_TYPE & aParent,
bool aIsAdding )
inlinestatic

◆ ProcessDeleteCommand()

template<typename PARENT_TYPE>
void WsfComponentFactoryList< PARENT_TYPE >::ProcessDeleteCommand ( const WsfScenario & aScenario,
UtInput & aInput,
PARENT_TYPE & aParent )
inlinestatic

◆ ProcessInput()


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