Cadabra
Computer algebra system for field theory problems
Toggle main menu visibility
Loading...
Searching...
No Matches
client_server
ScriptThread.hh
Go to the documentation of this file.
1
2
#pragma once
3
4
#include "
websocket_server.hh
"
5
6
7
namespace
cadabra
{
8
19
20
class
DocumentThread
;
21
class
GUIBase
;
22
23
class
ScriptThread
{
24
public
:
25
ScriptThread
(
DocumentThread
*,
GUIBase
*);
26
~ScriptThread
();
27
28
ScriptThread
(
const
ScriptThread
&) =
delete
;
29
30
void
run
();
31
void
terminate
();
32
33
uint16_t
get_local_port
()
const
;
34
std::string
get_authentication_token
()
const
;
35
36
private
:
37
void
on_message
(
websocket_server::id_type
id
,
const
std::string& msg,
38
const
websocket_server::request_type
& req,
const
std::string& ip_address);
39
void
on_open
(
websocket_server::id_type
id
);
40
void
on_close
(
websocket_server::id_type
id
);
41
42
websocket_server
wserver
;
43
DocumentThread
*
document
;
44
GUIBase
*
gui
;
45
46
// Authentication token, needs to be sent along with any message.
47
// Gets shown when we start up.
48
mutable
std::mutex
url_mutex
;
49
std::string
authentication_token
;
50
uint16_t
local_port
;
51
};
52
53
}
cadabra::DocumentThread
A base class with all the logic to manipulate a Cadabra notebook document.
Definition
DocumentThread.hh:41
cadabra::GUIBase
Abstract base class with methods that need to be implemented by any GUI.
Definition
GUIBase.hh:16
cadabra::ScriptThread::run
void run()
Definition
ScriptThread.cc:163
cadabra::ScriptThread::on_close
void on_close(websocket_server::id_type id)
Definition
ScriptThread.cc:45
cadabra::ScriptThread::on_open
void on_open(websocket_server::id_type id)
Definition
ScriptThread.cc:34
cadabra::ScriptThread::on_message
void on_message(websocket_server::id_type id, const std::string &msg, const websocket_server::request_type &req, const std::string &ip_address)
Definition
ScriptThread.cc:58
cadabra::ScriptThread::local_port
uint16_t local_port
Definition
ScriptThread.hh:50
cadabra::ScriptThread::ScriptThread
ScriptThread(DocumentThread *, GUIBase *)
Definition
ScriptThread.cc:18
cadabra::ScriptThread::authentication_token
std::string authentication_token
Definition
ScriptThread.hh:49
cadabra::ScriptThread::~ScriptThread
~ScriptThread()
Definition
ScriptThread.cc:29
cadabra::ScriptThread::get_authentication_token
std::string get_authentication_token() const
Definition
ScriptThread.cc:183
cadabra::ScriptThread::terminate
void terminate()
Definition
ScriptThread.cc:189
cadabra::ScriptThread::wserver
websocket_server wserver
Definition
ScriptThread.hh:42
cadabra::ScriptThread::get_local_port
uint16_t get_local_port() const
Definition
ScriptThread.cc:177
cadabra::ScriptThread::ScriptThread
ScriptThread(const ScriptThread &)=delete
cadabra::ScriptThread::gui
GUIBase * gui
Definition
ScriptThread.hh:44
cadabra::ScriptThread::url_mutex
std::mutex url_mutex
Definition
ScriptThread.hh:48
cadabra::ScriptThread::document
DocumentThread * document
Definition
ScriptThread.hh:43
websocket_server
Definition
websocket_server.hh:16
websocket_server::request_type
boost::beast::http::request< boost::beast::http::string_body > request_type
Definition
websocket_server.hh:19
websocket_server::id_type
std::size_t id_type
Definition
websocket_server.hh:18
cadabra
Functions to handle the exchange properties of two or more symbols in a product.
Definition
Adjform.cc:83
websocket_server.hh
Generated by
1.17.0