WSF
WsfScriptDefs.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 WSFSCRIPTDEFS_HPP
13#define WSFSCRIPTDEFS_HPP
14
15#include "UtScriptClassDefine.hpp"
16#include "UtScriptExecutorProgramCounter.hpp"
17#include "WsfScriptContext.hpp"
18
19// This file provides Preprocessor definitions for use inside script implementations.
20// These definitions mimic variables available in script
21#define TIME_NOW WsfScriptContext::GetTIME_NOW(aContext)
22#define PLATFORM WsfScriptContext::GetPLATFORM(aContext)
23#define PROCESSOR WsfScriptContext::GetPROCESSOR(aContext)
24#define MESSAGE WsfScriptContext::GetMESSAGE(aContext)
25#define TRACK WsfScriptContext::GetTRACK(aContext)
26#define SIMULATION WsfScriptContext::GetSIMULATION(aContext)
27#define SCENARIO WsfScriptContext::GetSCENARIO(aContext)
28
34#define WSF_SCRIPT_WARN_INIT \
35 UT_SCRIPT_WARN(SIMULATION->GetState() == WsfSimulation::cINITIALIZING, \
36 "Invalid method call during simulation initialization")
37
38#define WSF_SCRIPT_WARN_INIT_NOT_INIT2 \
39 if (SIMULATION->GetState() == WsfSimulation::cINITIALIZING) \
40 { \
41 auto callstack = aExecutorPtr->GetCallstack(); \
42 for (auto entry : callstack) \
43 { \
44 UT_SCRIPT_WARN( \
45 entry->mScriptPtr && (entry->mScriptPtr->GetName() == "on_initialize"), \
46 "Invalid method call during simulation initialization - method may be called during initialization2") \
47 } \
48 }
49
50#endif
Copyrights Multiple, All Rights Reserved