SOLA
Loading...
Searching...
No Matches
sola_manager.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_MANAGER_H_
18#define DAISI_SOLA_NS3_SOLA_MANAGER_H_
19
20#include <deque>
21
22#include "manager/core_network.h"
23#include "manager/general_scenariofile.h"
24#include "manager/manager.h"
25#include "ns3/node-container.h"
26#include "sola_application.h"
27#include "sola_logger_ns3.h"
28#include "sola_scenariofile.h"
29
30namespace daisi::sola_ns3 {
31
33class SolaManager : public Manager {
34public:
35 explicit SolaManager(const std::string &scenariofile_path);
36
37private:
38 void setupImpl() override;
39 std::string getDatabaseFilename() const override;
40 GeneralScenariofile getGeneralScenariofile() const override;
41
42 void startSOLA(uint32_t id);
43 void subscribeTopic(const std::string &topic, uint32_t id);
44 void publishTopic(uint32_t id, const std::string &topic, uint64_t msg_size);
45 void leaveTopic(uint32_t id);
46 void findService(uint32_t id);
47 void addService(uint32_t id);
48 void updateService(uint32_t id);
49 void removeService(uint32_t id);
50
51 void scheduleEvents();
52 uint64_t getNumberOfNodes() const;
53
54 // Scheduling methods, implemented in sola_manager_scheduler.cpp
55 void schedule(StartSOLA start, ns3::Time &current_time);
56 void schedule(SubscribeTopic subscribe, ns3::Time &current_time);
57 void schedule(Delay delay, ns3::Time &current_time) const;
58 void schedule(Publish publish, ns3::Time &current_time);
59
60 ns3::Ptr<SolaApplication> getApplication(uint32_t id) const;
61
62 SolaScenariofile scenariofile_;
63
64 ns3::NodeContainer nodes_;
65 CoreNetwork core_network_;
66};
67
68} // namespace daisi::sola_ns3
69
70#endif
Network structure with one central L3 router, forming a star topology.
Definition core_network.h:34
Definition manager.h:26
Basic manager to test SOLA features standalone within simulation.
Definition sola_manager.h:33
Definition general_scenariofile.h:28
Definition sola_scenariofile.h:45
Definition sola_scenariofile.h:53
Definition sola_scenariofile.h:69
Definition sola_scenariofile.h:28
Definition sola_scenariofile.h:36