Horizon
pool-mgr-app.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "util/uuid.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include <map>
6 #include <zmq.hpp>
7 #include <glibmm/datetime.h>
8 
9 namespace horizon {
10 using json = nlohmann::json;
11 
12 class PoolManagerApplication : public Gtk::Application {
13 protected:
15 
16 public:
17  static Glib::RefPtr<PoolManagerApplication> create();
18  std::string get_config_filename();
19  const std::string &get_ep_broadcast() const;
20  void send_json(int pid, const json &j);
21  zmq::context_t zctx;
22 
23  std::map<std::string, Glib::DateTime> recent_items;
24 
25 
26 protected:
27  // Override default signal handlers:
28  void on_activate() override;
29  void on_startup() override;
30  void on_shutdown();
31  void on_open(const Gio::Application::type_vec_files &files, const Glib::ustring &hint) override;
32 
33  std::string sock_broadcast_ep;
34 
35 
36 private:
37  class PoolManagerAppWindow *create_appwindow();
38  void on_hide_window(Gtk::Window *window);
39  void on_action_quit();
40  void on_action_preferences();
41 
42 public:
43  zmq::socket_t sock_broadcast;
44 };
45 } // namespace horizon
a class to store JSON values
Definition: json.hpp:161
Definition: pool-mgr-app_win.hpp:13
Definition: pool-mgr-app.hpp:12
Definition: block.cpp:7
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61