SOLA
Loading...
Searching...
No Matches
sola_application.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_APPLICATION_H_
18#define DAISI_SOLA_NS3_SOLA_APPLICATION_H_
19
20#include "logging/logger_manager.h"
21#include "ns3/application.h"
22#include "ns3/ipv4-address.h"
23#include "ns3/packet.h"
24#include "ns3/ptr.h"
25#include "ns3/simulator.h"
26#include "ns3/socket.h"
27#include "ns3/uinteger.h"
28#include "sola_logger_ns3.h"
29#include "sola_wrapper.h"
30
31namespace daisi::sola_ns3 {
32
33class SolaApplication : public ns3::Application {
34public:
35 static ns3::TypeId GetTypeId();
36 SolaApplication() = default;
37
38 // Start SOLA later as the application
39 void startSOLA();
40
41 std::string getIP() const;
42 uint16_t getPort() const;
43
44 void subscribeTopic(const std::string &topic);
45 void publishTopic(const std::string &topic, const std::string &msg);
46
47private:
48 uint32_t id_ = 0;
49
50 std::unique_ptr<SOLAWrapper> sola_;
51
52 ns3::Ipv4Address local_ip_address_;
53
54 uint16_t listening_port_ = 0;
55};
56} // namespace daisi::sola_ns3
57#endif
Definition sola_application.h:33