WSF
WsfScriptCallback.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 WSFSCRIPTCALLBACK_HPP
13#define WSFSCRIPTCALLBACK_HPP
14
15#include "wsf_export.h"
16
17#include <vector>
18
19class UtInput;
20class WsfPlatform;
21class UtScriptClass;
22class UtScriptMethod;
23
24#include "WsfCallback.hpp"
25
31{
32public:
33 WsfScriptCallback() = default;
34 WsfScriptCallback(const std::string& aScriptName);
35 WsfScriptCallback(const std::string& aScriptName, const std::string& aProcessorName);
36 WsfScriptCallback(const UtScriptMethod& aMethod);
38 ~WsfScriptCallback() override;
39
40 WsfCallback* Clone() const override;
41 bool Initialize(double aSimTime) override;
42 bool ProcessInput(UtInput& aInput) override;
43
44 bool Execute(double aSimTime, WsfPlatform* aPlatformPtr) override;
45
46protected:
48
49private:
50 void GetNextValue(UtInput& aInput, std::string& aCommand);
51
52 struct ScriptAndSource
53 {
54 ScriptAndSource()
55 : mScriptId(nullptr)
56 , mProcId(nullptr)
57 , mMethodPtr(nullptr)
58 {
59 }
60 WsfStringId mScriptId;
61 WsfStringId mProcId;
62 UtScriptMethod* mMethodPtr;
63 };
64
65 UtScriptClass* mPlatformScriptClassPtr{nullptr};
66 std::vector<ScriptAndSource> mScriptList;
67};
68
69#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfCallback()
Definition WsfCallback.cpp:21
virtual bool Execute(double aSimTime, WsfPlatform *aPlatformPtr)=0
bool ProcessInput(UtInput &aInput) override
Definition WsfCallback.hpp:45
WsfCallback * Clone() const override=0
virtual bool Initialize(double aSimTime)
Definition WsfComponent.cpp:45
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
WsfScriptCallback & operator=(const WsfScriptCallback &aRhs)=delete
WsfScriptCallback()=default
Copyrights Multiple, All Rights Reserved