Skip to content

Commit

Permalink
updating context creation in the exemple (#413)
Browse files Browse the repository at this point in the history
* updating context creation in the exemple

* removing reference to make_xserver_zmq
  • Loading branch information
SandrineP authored Dec 17, 2024
1 parent b43c88c commit d1a9fa4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/source/example/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

#include "xeus/xkernel.hpp"
#include "xeus/xkernel_configuration.hpp"

#include "xeus-zmq/xserver_zmq.hpp"
#include "xeus-zmq/xzmq_context.hpp"

#include "custom_interpreter.hpp"

Expand All @@ -21,14 +23,15 @@ int main(int argc, char* argv[])
std::string file_name = (argc == 1) ? "connection.json" : argv[2];
xeus::xconfiguration config = xeus::load_configuration(file_name);

auto context = xeus::make_context<zmq::context_t>();
// Create context
std::unique_ptr<xeus::xcontext> context = xeus::make_zmq_context();

// Create interpreter instance
using interpreter_ptr = std::unique_ptr<custom::custom_interpreter>;
interpreter_ptr interpreter = interpreter_ptr(new custom::custom_interpreter());

// Create kernel instance and start it
xeus::xkernel kernel(config, xeus::get_user_name(), std::move(context), std::move(interpreter), xeus::make_xserver_zmq);
xeus::xkernel kernel(config, xeus::get_user_name(), std::move(context), std::move(interpreter), xeus::make_xserver_default);
kernel.start();

return 0;
Expand Down

0 comments on commit d1a9fa4

Please sign in to comment.