FlightGear
next
MirrorPropertyTreeWebsocket.hxx
Go to the documentation of this file.
1
// MirrorPropertyTreeWebsocket.hxx -- A websocket for mirroring a property sub-tree
2
//
3
// Written by James Turner, started November 2016.
4
//
5
// Copyright (C) 2016 James Turner
6
//
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public License as
9
// published by the Free Software Foundation; either version 2 of the
10
// License, or (at your option) any later version.
11
//
12
// This program is distributed in the hope that it will be useful, but
13
// WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
// General Public License for more details.
16
//
17
// You should have received a copy of the GNU General Public License
18
// along with this program; if not, write to the Free Software
19
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21
#ifndef MIRROR_PROP_TREE_WEBSOCKET_HXX_
22
#define MIRROR_PROP_TREE_WEBSOCKET_HXX_
23
24
#include "
Websocket.hxx
"
25
26
#include <simgear/props/props.hxx>
27
#include <simgear/timing/timestamp.hxx>
28
29
#include <vector>
30
#include <memory>
31
32
namespace
flightgear
{
33
namespace
http
{
34
35
class
MirrorTreeListener
;
36
37
class
MirrorPropertyTreeWebsocket
:
public
Websocket
38
{
39
public
:
40
MirrorPropertyTreeWebsocket
(
const
std::string& path);
41
~MirrorPropertyTreeWebsocket
()
override
;
42
43
void
close
()
override
;
44
void
handleRequest
(
const
HTTPRequest
& request,
WebsocketWriter
& writer)
override
;
45
void
poll
(
WebsocketWriter
& writer)
override
;
46
47
private
:
48
void
checkNodeExists();
49
50
friend
class
MirrorTreeListener
;
51
52
std::string _rootPath;
53
SGPropertyNode_ptr _subtreeRoot;
54
std::unique_ptr<MirrorTreeListener> _listener;
55
int
_minSendInterval;
56
SGTimeStamp _lastSendTime;
57
};
58
59
}
60
}
61
62
#endif
/* MIRROR_PROP_TREE_WEBSOCKET_HXX_ */
Websocket.hxx
flightgear::http::HTTPRequest
Definition
HTTPRequest.hxx:31
flightgear::http::MirrorPropertyTreeWebsocket::MirrorPropertyTreeWebsocket
MirrorPropertyTreeWebsocket(const std::string &path)
Definition
MirrorPropertyTreeWebsocket.cxx:420
flightgear::http::MirrorPropertyTreeWebsocket::poll
void poll(WebsocketWriter &writer) override
Definition
MirrorPropertyTreeWebsocket.cxx:514
flightgear::http::MirrorPropertyTreeWebsocket::MirrorTreeListener
friend class MirrorTreeListener
Definition
MirrorPropertyTreeWebsocket.hxx:50
flightgear::http::MirrorPropertyTreeWebsocket::~MirrorPropertyTreeWebsocket
~MirrorPropertyTreeWebsocket() override
Definition
MirrorPropertyTreeWebsocket.cxx:428
flightgear::http::MirrorPropertyTreeWebsocket::close
void close() override
Definition
MirrorPropertyTreeWebsocket.cxx:432
flightgear::http::MirrorPropertyTreeWebsocket::handleRequest
void handleRequest(const HTTPRequest &request, WebsocketWriter &writer) override
Definition
MirrorPropertyTreeWebsocket.cxx:449
flightgear::http::MirrorTreeListener
Definition
MirrorPropertyTreeWebsocket.cxx:137
flightgear::http::WebsocketWriter
Definition
Websocket.hxx:30
flightgear::http::Websocket
Definition
Websocket.hxx:66
flightgear::http
Definition
FlightHistoryUriHandler.cxx:33
flightgear
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
Definition
Addon.cxx:53
src
Network
http
MirrorPropertyTreeWebsocket.hxx
Generated on Tue Jun 3 2025 12:58:41 for FlightGear by
1.13.2