ORE Studio 0.0.4
Loading...
Searching...
No Matches
subscription_commands.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_COMMS_SHELL_APP_COMMANDS_SUBSCRIPTION_COMMANDS_HPP
21#define ORES_COMMS_SHELL_APP_COMMANDS_SUBSCRIPTION_COMMANDS_HPP
22
23#include <string>
24#include "ores.comms/net/client_session.hpp"
25
26namespace cli {
27
28class Menu;
29
30}
31
32namespace ores::comms::shell::app::commands {
33
45public:
55 static void register_commands(cli::Menu& root,
57
67 static void process_channels(std::ostream& out,
69
77 static void process_listen(std::ostream& out,
79 std::string event_type);
80
88 static void process_unlisten(std::ostream& out,
90 std::string event_type);
91
98 static void process_subscriptions(std::ostream& out,
100
107 static void process_notifications(std::ostream& out,
109
120 static std::size_t display_pending_notifications(std::ostream& out,
122};
123
124}
125
126#endif
Manages commands related to event subscriptions and notifications.
Definition subscription_commands.hpp:44
static void process_channels(std::ostream &out, comms::net::client_session &session)
List available event channels.
Definition subscription_commands.cpp:67
static void process_listen(std::ostream &out, comms::net::client_session &session, std::string event_type)
Process a listen (subscribe) request.
Definition subscription_commands.cpp:96
static void process_unlisten(std::ostream &out, comms::net::client_session &session, std::string event_type)
Process an unlisten (unsubscribe) request.
Definition subscription_commands.cpp:164
static std::size_t display_pending_notifications(std::ostream &out, comms::net::client_session &session)
Display pending notifications without clearing them.
Definition subscription_commands.cpp:251
static void register_commands(cli::Menu &root, comms::net::client_session &session)
Register subscription management commands.
Definition subscription_commands.cpp:36
static void process_subscriptions(std::ostream &out, comms::net::client_session &session)
Display current subscriptions.
Definition subscription_commands.cpp:214
static void process_notifications(std::ostream &out, comms::net::client_session &session)
Display and clear pending notifications.
Definition subscription_commands.cpp:234
Client-side session manager providing auth-aware request handling.
Definition client_session.hpp:125