FlightGear next
FGOutputSocket.h
Go to the documentation of this file.
1/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3 Header: FGOutputSocket.h
4 Author: Bertrand Coconnier
5 Date started: 09/10/11
6
7 ------------- Copyright (C) 2011 Bertrand Coconnier -------------
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 Software
11 Foundation; either version 2 of the License, or (at your option) any later
12 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 with
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21 Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 Further information about the GNU Lesser General Public License can also be found on
24 the world wide web at http://www.gnu.org.
25
26HISTORY
27--------------------------------------------------------------------------------
2809/10/11 BC Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGOUTPUTSOCKET_H
35#define FGOUTPUTSOCKET_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include "FGOutputType.h"
44
45/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46FORWARD DECLARATIONS
47%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48
49namespace JSBSim {
50
51/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52CLASS DOCUMENTATION
53%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54
61
62/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63CLASS DECLARATION
64%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
65
67{
68public:
71
73 ~FGOutputSocket() override;
74
83 void SetOutputName(const std::string& name) override;
84
88 bool Load(Element* el) override;
89
94 bool InitModel(void) override;
96 void Print(void) override;
97
102 void SocketStatusOutput(const std::string& out_str);
103
104protected:
105 virtual void PrintHeaders(void);
106
107 std::string SockName;
108 unsigned int SockPort;
112};
113}
114//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115#endif
void SocketStatusOutput(const std::string &out_str)
Outputs a status thru the socket.
void Print(void) override
Generates the output.
FGfdmSocket::ProtocolType SockProtocol
~FGOutputSocket() override
Destructor.
bool InitModel(void) override
Initializes the instance.
void SetOutputName(const std::string &name) override
Overwrites the name identifier under which the output will be logged.
virtual void PrintHeaders(void)
FGOutputSocket(FGFDMExec *fdmex)
Constructor.
bool Load(Element *el) override
Init the output directives from an XML file.
FGOutputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
Encapsulates an object that enables JSBSim to communicate via socket (input and/or output).
Definition FGfdmSocket.h:71
const char * name