Cadabra
Computer algebra system for field theory problems
cadabra-jupyter-kernel.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "xeus/xinterpreter.hpp"
5 #include "xeus/xjson.hpp"
6 #include "Server.hh"
7 
8 using xeus::xinterpreter;
9 using xeus::xjson;
10 
11 namespace cadabra {
12 
18 
19  class CadabraJupyter : public xinterpreter, public Server {
20  public:
21 
23  virtual ~CadabraJupyter() = default;
24 
25  virtual uint64_t send(const std::string& output, const std::string& msg_type, uint64_t parent_id, bool last) override;
26 
28  bool finished=true;
29 
30  protected:
31  virtual void on_block_error(Block) override;
32 
33  private:
34 
35  void configure_impl() override;
36 
37  xjson execute_request_impl(int execution_counter,
38  const std::string& code,
39  bool silent,
40  bool store_history,
41  xjson user_expressions,
42  bool allow_stdin) override;
43 
44  xjson complete_request_impl(const std::string& code,
45  int cursor_pos) override;
46 
47  xjson inspect_request_impl(const std::string& code,
48  int cursor_pos,
49  int detail_level) override;
50 
51  xjson is_complete_request_impl(const std::string& code) override;
52 
53  xjson kernel_info_request_impl() override;
54 
55  void shutdown_request_impl() override;
56  };
57  }
cadabra::CadabraJupyter::execute_request_impl
xjson execute_request_impl(int execution_counter, const std::string &code, bool silent, bool store_history, xjson user_expressions, bool allow_stdin) override
Definition: cadabra-jupyter-kernel.cc:29
Server
Definition: Server.hh:33
Server.hh
cadabra::CadabraJupyter::~CadabraJupyter
virtual ~CadabraJupyter()=default
Server::Block
Definition: Server.hh:149
cadabra::CadabraJupyter::CadabraJupyter
CadabraJupyter()
Definition: cadabra-jupyter-kernel.cc:10
cadabra::CadabraJupyter::on_block_error
virtual void on_block_error(Block) override
Definition: cadabra-jupyter-kernel.cc:61
cadabra::CadabraJupyter::configure_impl
void configure_impl() override
Definition: cadabra-jupyter-kernel.cc:17
cadabra::CadabraJupyter::current_counter
int current_counter
Definition: cadabra-jupyter-kernel.hh:27
cadabra::CadabraJupyter
Definition: cadabra-jupyter-kernel.hh:19
cadabra::CadabraJupyter::complete_request_impl
xjson complete_request_impl(const std::string &code, int cursor_pos) override
Definition: cadabra-jupyter-kernel.cc:104
cadabra::CadabraJupyter::inspect_request_impl
xjson inspect_request_impl(const std::string &code, int cursor_pos, int detail_level) override
Definition: cadabra-jupyter-kernel.cc:121
cadabra::CadabraJupyter::send
virtual uint64_t send(const std::string &output, const std::string &msg_type, uint64_t parent_id, bool last) override
Raw code to send a string (which must be JSON formatted) as a message to the client.
Definition: cadabra-jupyter-kernel.cc:77
cadabra::CadabraJupyter::shutdown_request_impl
void shutdown_request_impl() override
Definition: cadabra-jupyter-kernel.cc:163
cadabra
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
cadabra::CadabraJupyter::kernel_info_request_impl
xjson kernel_info_request_impl() override
Definition: cadabra-jupyter-kernel.cc:150
cadabra::CadabraJupyter::finished
bool finished
Definition: cadabra-jupyter-kernel.hh:28
cadabra::CadabraJupyter::is_complete_request_impl
xjson is_complete_request_impl(const std::string &code) override
Definition: cadabra-jupyter-kernel.cc:138