WSF
WsfComponentFactory< PARENT_TYPE > Class Template Reference

A template that defines a component factory for a given parent class. More...

#include <WsfComponentFactory.hpp>

Inheritance diagram for WsfComponentFactory< PARENT_TYPE >:
Collaboration diagram for WsfComponentFactory< PARENT_TYPE >:

Public Member Functions

 WsfComponentFactory ()
virtual void PreInput (PARENT_TYPE &aParent)
Public Member Functions inherited from WsfComponentFactoryBase
 WsfComponentFactoryBase (int aParentRole)
virtual ~WsfComponentFactoryBase ()
int GetParentRole () const
 Return the parent role of the factory.

Input processing.

Component factories will override one or more methods depending on their implementation.

virtual bool ProcessInput (UtInput &aInput, PARENT_TYPE &aParent)
virtual bool ProcessAddOrEditCommand (UtInput &aInput, PARENT_TYPE &aParent, bool aIsAdding)
virtual bool ProcessDeleteCommand (UtInput &aInput, PARENT_TYPE &aParent)

Parent Pre-Initialization.

virtual bool PreInitialize (double aSimTime, PARENT_TYPE &aParent)

Additional Inherited Members

Protected Member Functions inherited from WsfComponentFactoryBase
WsfScenarioGetScenario () const
 Returns a reference to the scenario to which this factory is registered.

Detailed Description

template<typename PARENT_TYPE>
class WsfComponentFactory< PARENT_TYPE >

A template that defines a component factory for a given parent class.

Constructor & Destructor Documentation

◆ WsfComponentFactory()

template<typename PARENT_TYPE>
WsfComponentFactory< PARENT_TYPE >::WsfComponentFactory ( )
inline

Member Function Documentation

◆ PreInitialize()

template<typename PARENT_TYPE>
virtual bool WsfComponentFactory< PARENT_TYPE >::PreInitialize ( double aSimTime,
PARENT_TYPE & aParent )
inlinevirtual

Perform pre-initialization function. This is called by the parents Initialize prior to actually initializing the components on the parent (i.e.: calling Initialize and Initialize2 for each component). The primary reason for this method is to allow the factory to check for the existence of a required component and either add it or cause a failure. The method may examine the component list on the parent but it must not assume ANYTHING about the actual state of the components.

Parameters
aSimTimeThe current simulation time.
aParentThe parent object being initialized.
Returns
true if successful or false if unsuccessful (bad input data, etc.)

Reimplemented in wsf::comm::medium::ContainerFactory< PARENT >.

◆ PreInput()

template<typename PARENT_TYPE>
virtual void WsfComponentFactory< PARENT_TYPE >::PreInput ( PARENT_TYPE & aParent)
inlinevirtual

Pre-input processing.

See also
WsfComponent::PreInput for what this does.
Note
Factories must be aware this method could be called more than once for a given parent object.

◆ ProcessAddOrEditCommand()

template<typename PARENT_TYPE>
virtual bool WsfComponentFactory< PARENT_TYPE >::ProcessAddOrEditCommand ( UtInput & aInput,
PARENT_TYPE & aParent,
bool aIsAdding )
inlinevirtual

Process the implicit or explicit 'add' or 'edit' command. This is typically used by the component factories whose parent is WsfPlatform. Others may use this if they follow similar syntax.

Parameters
aInputThe input stream.
aParentThe parent object.
aIsAdding'true' if the component is being added to the parent or 'false' if an existing component is to be edited.
Returns
true if the command was recognized and processed, or false if not (pass to the next factory).

Reimplemented in impl::MultiresolutionComponentFactory< DerivedComponent >, and wsf::comm::medium::ContainerFactory< PARENT >.

◆ ProcessDeleteCommand()

template<typename PARENT_TYPE>
virtual bool WsfComponentFactory< PARENT_TYPE >::ProcessDeleteCommand ( UtInput & aInput,
PARENT_TYPE & aParent )
inlinevirtual

Process the explicit component 'delete' command. This is typically used by component factories whose parent is WsfPlatform.

Parameters
aInputThe input stream.
aParentThe parent object.
Returns
true if the command was recognized and processed, or false if not (pass to the next factory).

Reimplemented in impl::MultiresolutionComponentFactory< DerivedComponent >, and wsf::comm::medium::ContainerFactory< PARENT >.

◆ ProcessInput()

template<typename PARENT_TYPE>
virtual bool WsfComponentFactory< PARENT_TYPE >::ProcessInput ( UtInput & aInput,
PARENT_TYPE & aParent )
inlinevirtual

Process input that may pertain to this component factory.

Parameters
aInputThe input stream.
aParentThe parent object.
Returns
true if the command was recognized and processed, or false if not (pass to the next factory).

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