SOLA
Loading...
Searching...
No Matches
sola_logger_ns3.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_SOLA_NS3_SOLA_LOGGER_NS3_H_
18#define DAISI_SOLA_NS3_SOLA_LOGGER_NS3_H_
19
20#include <ctime>
21#include <unordered_map>
22
23#include "SOLA/logger_interface.h"
24#include "logging/definitions.h"
25#include "logging/sqlite/sqlite_helper.h"
26
27namespace daisi::sola_ns3 {
28
30public:
31 SolaLoggerNs3(LogDeviceApp log_device_application, LogFunction log);
32
33 ~SolaLoggerNs3() override;
34
35 void logSubscribeTopic(const std::string &topic) const override;
36
37 void logUnsubscribeTopic(const std::string &topic) const override;
38
39 void logPublishTopicMessage(const sola::TopicMessage &msg) const override;
40
41 void logReceiveTopicMessage(const sola::TopicMessage &msg) const override;
42
43 void setApplicationUUID(const std::string &app_uuid) override;
44
45 void logMessageIDMapping(const solanet::UUID &sola_msg_uuid,
46 const solanet::UUID &ed_msg_uuid) const override;
47
48private:
49 enum TopicEventType {
50 kUnsubscribe,
51 kSubscribe,
52 };
53
54 enum TopicPublishType {
55 kPublish,
56 kReceive,
57 };
58
59 void logTopicEvent(const std::string &topic, TopicEventType event_type) const;
60
61 void logTopicMessage(const sola::TopicMessage &ms, TopicPublishType type) const;
62
63 LogDeviceApp log_device_application_;
64 LogFunction log_;
65};
66
67} // namespace daisi::sola_ns3
68
69#endif
Definition sola_logger_ns3.h:29
void logMessageIDMapping(const solanet::UUID &sola_msg_uuid, const solanet::UUID &ed_msg_uuid) const override
Definition sola_logger_ns3.cpp:115
void setApplicationUUID(const std::string &app_uuid) override
Definition sola_logger_ns3.cpp:133
Definition logger_interface.h:24
Definition message.h:20