ORE Studio 0.0.4
Loading...
Searching...
No Matches
application.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_ANALYSER_APP_APPLICATION_HPP
21#define ORES_COMMS_ANALYSER_APP_APPLICATION_HPP
22
23#include "ores.logging/make_logger.hpp"
24#include "ores.comms.analyser/config/options.hpp"
25#include "ores.comms.analyser/domain/session_reader.hpp"
26
28
32class application final {
33private:
34 inline static std::string_view logger_name = "ores.comms.analyser.app.application";
35
36 static auto& lg() {
37 using namespace ores::logging;
38 static auto instance = make_logger(logger_name);
39 return instance;
40 }
41
42public:
46 explicit application(config::options opts);
47
53 int run();
54
55private:
59 int read_session();
60
64 int show_info();
65
72 bool show_info_for_file(const std::filesystem::path& file_path);
73
80 bool read_session_file(const std::filesystem::path& file_path);
81
85 void print_header(const std::filesystem::path& file_path,
86 const domain::session_metadata& metadata);
87
91 void print_frames(const domain::session_data& data);
92
96 static std::string format_timestamp(std::int64_t offset_us);
97
101 static std::string get_message_info(const comms::messaging::frame& f);
102
103 config::options opts_;
104};
105
106}
107
108#endif
Application hosting for the communication session analyzer.
Definition application.hpp:27
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Main application for the session analyser.
Definition application.hpp:32
int run()
Run the application.
Definition application.cpp:39
Configuration options for the analyser.
Definition options.hpp:39
Metadata about a recorded session.
Definition session_reader.hpp:40
Complete session data including metadata and frames.
Definition session_reader.hpp:61
Complete frame with header and payload.
Definition frame.hpp:77