WSF
Function.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 FUNCTION_HPP
13#define FUNCTION_HPP
14
15#include "sensor_plot_lib_export.h"
16
17#include <string>
18
19#include "UtCallbackHolder.hpp"
21
22class UtInput;
24class WsfScenario;
25class WsfSimulation;
26
28class SENSOR_PLOT_LIB_EXPORT Function
29{
30public:
31 Function(const Function&) = default;
32 Function(const WsfScenario& aScenario, const std::string& aScriptClassName = "");
33 virtual ~Function() = default;
34
35 virtual bool Execute(WsfSimulation& aSimulation) = 0;
36 virtual bool ProcessInput(UtInput& aInput) = 0;
37
38 const std::string& GetCommand() const { return mCommand; }
39 void SetCommand(const std::string& aCommand) { mCommand = aCommand; }
40
41 const WsfScenario& GetScenario() const { return mScenario; }
42
43 const std::string& GetPlotName() const { return mPlotName; }
46 bool IsPlatformAvailabilitySpecified() const { return mIsPlatformAvailabilitySpecified; }
47
48 static bool IsSensorPlotMode();
49
50protected:
52
53private:
54 void CallOnComplete(double);
55
56 const WsfScenario& mScenario;
57 bool mIsPlatformAvailabilitySpecified{false};
58 std::string mPlotName;
59 std::string mCommand;
60 WsfScriptContext mScriptContext;
61 UtCallbackHolder mFunctionCallbacks;
62};
63
64#endif
bool IsPlatformAvailabilitySpecified() const
Has the user provided a platform_availability block for the plot?
Definition Function.hpp:46
virtual ~Function()=default
const WsfScenario & GetScenario() const
Definition Function.hpp:41
const std::string & GetCommand() const
Definition Function.hpp:38
const WsfPlatformAvailability & GetPlatformAvailability() const
Definition Function.hpp:44
void SetCommand(const std::string &aCommand)
Definition Function.hpp:39
WsfPlatformAvailability mPlatformAvailability
Definition Function.hpp:51
virtual bool ProcessInput(UtInput &aInput)=0
Definition Function.cpp:31
const std::string & GetPlotName() const
Definition Function.hpp:43
Function(const Function &)=default
virtual bool Execute(WsfSimulation &aSimulation)=0
Definition Function.cpp:52
Definition WsfPlatformAvailability.hpp:27
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfScriptContext.hpp:71
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Copyrights Multiple, All Rights Reserved