Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
ScriptThread.hh
Go to the documentation of this file.
1
2#pragma once
3
4#include "websocket_server.hh"
5#include <future>
6
7
8namespace cadabra {
9
20
21 class DocumentThread;
22 class GUIBase;
23
25 public:
28
29 ScriptThread(const ScriptThread&) = delete;
30
31 void run();
32 void terminate();
33
35 std::string get_authentication_token() const;
36
37 private:
38 void on_message(websocket_server::id_type id, const std::string& msg,
39 const websocket_server::request_type& req, const std::string& ip_address);
42
46
47 // Authentication token, needs to be sent along with any message.
48 // Gets shown when we start up.
51 // Fulfilled by run() once local_port is known.
52 std::promise<void> url_promise;
53 std::shared_future<void> url_ready;
54 };
55
56}
A base class with all the logic to manipulate a Cadabra notebook document.
Definition DocumentThread.hh:41
Abstract base class with methods that need to be implemented by any GUI.
Definition GUIBase.hh:16
Definition ScriptThread.hh:24
void run()
Definition ScriptThread.cc:162
void on_close(websocket_server::id_type id)
Definition ScriptThread.cc:40
void on_open(websocket_server::id_type id)
Definition ScriptThread.cc:29
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:53
uint16_t local_port
Definition ScriptThread.hh:50
std::string authentication_token
Definition ScriptThread.hh:49
std::promise< void > url_promise
Definition ScriptThread.hh:52
~ScriptThread()
Definition ScriptThread.cc:25
std::string get_authentication_token() const
Definition ScriptThread.cc:189
void terminate()
Definition ScriptThread.cc:194
std::shared_future< void > url_ready
Definition ScriptThread.hh:53
websocket_server wserver
Definition ScriptThread.hh:43
uint16_t get_local_port() const
Definition ScriptThread.cc:182
ScriptThread(const ScriptThread &)=delete
GUIBase * gui
Definition ScriptThread.hh:45
DocumentThread * document
Definition ScriptThread.hh:44
Definition websocket_server.hh:16
boost::beast::http::request< boost::beast::http::string_body > request_type
Definition websocket_server.hh:19
std::size_t id_type
Definition websocket_server.hh:18
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1180