WSF
WsfProcessor.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFPROCESSOR_HPP
13#define WSFPROCESSOR_HPP
14
15#include "wsf_export.h"
16
17class UtInput;
18class WsfCallback;
19#include "WsfComponentList.hpp"
20class WsfMessage;
21class WsfPlatform;
22#include "WsfPlatformPart.hpp"
23class WsfProcessor;
25#include "WsfVariable.hpp"
26
39{
40public:
41 WsfProcessor(const WsfScenario& aScenario);
42 ~WsfProcessor() override = default;
43
46
48 ComponentList& GetComponents() { return mComponents; }
49 const ComponentList& GetComponents() const { return mComponents; }
51
53
54 WsfComponent* CloneComponent() const override { return Clone(); }
55 const int* GetComponentRoles() const override;
56 void* QueryInterface(int aRole) override;
59
61
62 const char* GetScriptClassName() const override;
65 WsfProcessor* Clone() const override = 0;
66 bool PreInitialize(double aSimTime) override;
67 bool Initialize(double aSimTime) override;
68 bool Initialize2(double aSimTime) override;
69 void PreInput() override;
70 bool ProcessInput(UtInput& aInput) override;
71 void Update(double aSimTime) override;
73
75
76 void TurnOff(double aSimTime) override;
77 void TurnOn(double aSimTime) override;
78 void SetNonOperational(double aSimTime) override;
79 void SetOperational(double aSimTime) override;
80 void PartBroken(double aSimTime) override;
82
84
85 double GetUpdateInterval() const override;
86 void SetUpdateInterval(double aUpdateInterval) override;
88
91 virtual void ProcessCallback(double aSimTime, const WsfCallback& aCallback);
93
94protected:
95 WsfProcessor(const WsfProcessor& aSrc);
96 WsfProcessor& operator=(const WsfProcessor& aRhs) = delete;
97
98private:
99 ComponentList mComponents;
100
103 WsfVariable<double> mUpdateInterval;
104};
105
107
108#endif
@ cWSF_INITIALIZE_ORDER_PROCESSOR
Definition WsfComponentRoles.hpp:177
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_PROCESSOR
A 'processor' component (WsfProcessor).
Definition WsfComponentRoles.hpp:104
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfCallback.hpp:27
A component list that stores only components of a specified type.
Definition WsfComponentList.hpp:343
Definition WsfComponent.hpp:39
virtual bool PreInitialize(double aSimTime)
Definition WsfComponent.cpp:24
virtual void PreInput()
Definition WsfComponent.cpp:86
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
virtual WsfObject * Clone() const =0
virtual void Update(double aSimTime)
Definition WsfPlatformPart.cpp:322
virtual void SetOperational(double aSimTime)
Definition WsfPlatformPart.cpp:661
virtual void PartBroken(double aSimTime)
Definition WsfPlatformPart.cpp:232
bool Initialize2(double aSimTime) override
Definition WsfPlatformPart.cpp:291
const char * GetScriptClassName() const override
Definition WsfPlatformPart.cpp:683
void * QueryInterface(int aRole) override
Definition WsfPlatformPart.cpp:143
virtual double GetUpdateInterval() const =0
virtual void TurnOff(double aSimTime)
Definition WsfPlatformPart.cpp:606
virtual void SetUpdateInterval(double aUpdateInterval)=0
WsfPlatformPart(const WsfScenario &aScenario, int aPartType)
Definition WsfPlatformPart.cpp:62
virtual void TurnOn(double aSimTime)
Definition WsfPlatformPart.cpp:622
bool Initialize(double aSimTime) override
Definition WsfPlatformPart.cpp:276
const int * GetComponentRoles() const override
Definition WsfPlatformPart.cpp:137
bool ProcessInput(UtInput &aInput) override
Definition WsfPlatformPart.cpp:347
virtual void SetNonOperational(double aSimTime)
Definition WsfPlatformPart.cpp:642
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Definition WsfProcessor.hpp:39
ComponentList & GetComponents()
Definition WsfProcessor.hpp:48
~WsfProcessor() override=default
WsfProcessor & operator=(const WsfProcessor &aRhs)=delete
WsfProcessor * Clone() const override=0
virtual void ProcessCallback(double aSimTime, const WsfCallback &aCallback)
Definition WsfProcessor.cpp:241
const ComponentList & GetComponents() const
Definition WsfProcessor.hpp:49
WsfComponent * CloneComponent() const override
Definition WsfProcessor.hpp:54
WsfProcessor(const WsfScenario &aScenario)
Definition WsfProcessor.cpp:25
int GetComponentInitializationOrder() const override
Definition WsfProcessor.hpp:57
WsfComponentListT< WsfProcessorComponent > ComponentList
Definition WsfProcessor.hpp:47
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfVariable.hpp:149
Copyrights Multiple, All Rights Reserved