JSBSim Flight Dynamics Model  1.2.0 (05 Nov 2023)
An Open Source Flight Dynamics and Control Software Library in C++
FGModelFunctions.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3 Header: FGModelFunctions.h
4 Author: Jon Berndt
5 Date started: August 2010
6 
7  ------------- Copyright (C) 2010 Jon S. Berndt (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free
11  Software Foundation; either version 2 of the License, or (at your option) any
12  later version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser General Public License along
20  with this program; if not, write to the Free Software Foundation, Inc., 59
21  Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be
24  found on the world wide web at http://www.gnu.org.
25 
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 SENTRY
28 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
29 
30 #ifndef FGMODELFUNCTIONS_H
31 #define FGMODELFUNCTIONS_H
32 
33 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 INCLUDES
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
36 
37 #include <memory>
38 
39 #include "FGJSBBase.h"
40 #include "input_output/FGPropertyReader.h"
41 
42 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 FORWARD DECLARATIONS
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
45 
46 namespace JSBSim {
47 
48 class FGFunction;
49 class Element;
50 class FGPropertyManager;
51 class FGFDMExec;
52 
53 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 CLASS DOCUMENTATION
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
56 
70 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 DECLARATION: FGModelFunctions
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
73 
75 {
76 public:
77  void RunPreFunctions(void);
78  void RunPostFunctions(void);
79  bool Load(Element* el, FGFDMExec* fdmex, std::string prefix="");
80  void PreLoad(Element* el, FGFDMExec* fdmex, std::string prefix="");
81  void PostLoad(Element* el, FGFDMExec* fdmex, std::string prefix="");
82 
86  std::string GetFunctionStrings(const std::string& delimeter) const;
87 
92  std::string GetFunctionValues(const std::string& delimeter) const;
93 
98  std::shared_ptr<FGFunction> GetPreFunction(const std::string& name);
99 
100 protected:
101  std::vector <std::shared_ptr<FGFunction>> PreFunctions;
102  std::vector <std::shared_ptr<FGFunction>> PostFunctions;
103  FGPropertyReader LocalProperties;
104 
105  virtual bool InitModel(void);
106 };
107 
108 } // namespace JSBSim
109 
110 #endif
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:184
JSBSim Base class.
Definition: FGJSBBase.h:118
The model functions class provides the capability for loading, storing, and executing arbitrary funct...
std::string GetFunctionStrings(const std::string &delimeter) const
Gets the strings for the current set of functions.
std::string GetFunctionValues(const std::string &delimeter) const
Gets the function values.
std::shared_ptr< FGFunction > GetPreFunction(const std::string &name)
Get one of the "pre" function.