SOLA
Loading...
Searching...
No Matches
sola_scenariofile.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_SCENARIOFILE_H_
18#define DAISI_SOLA_NS3_SOLA_SCENARIOFILE_H_
19
20#include <string>
21#include <variant>
22
23#include "manager/general_scenariofile.h"
24#include "ns3/core-module.h"
25
26namespace daisi::sola_ns3 {
27
28struct StartSOLA {
29 static std::string typeName() { return "start_sola"; }
30
31 ns3::Time delay;
32
33 void parse(const YAML::Node &node);
34};
35
37 static std::string typeName() { return "subscribe_topic"; }
38
39 std::string topic;
40 ns3::Time delay;
41
42 void parse(const YAML::Node &node);
43};
44
45struct Delay {
46 static std::string typeName() { return "delay"; }
47
48 ns3::Time delay;
49
50 void parse(const YAML::Node &node);
51};
52
53struct Publish {
54 static std::string typeName() { return "publish"; }
55
56 std::string topic;
57 uint64_t message_size; // in bytes
58 uint64_t node_id;
59
60 void parse(const YAML::Node &node);
61};
62
64 std::variant<StartSOLA, SubscribeTopic, Delay, Publish> step;
65
66 void parse(const YAML::Node &node);
67};
68
70 explicit SolaScenariofile(const std::string &path_to_file);
71
72 uint32_t number_nodes = 0;
73
74 std::vector<SolaScenarioSequenceStep> scenario_sequence;
75};
76} // namespace daisi::sola_ns3
77#endif
Definition general_scenariofile.h:28
Definition sola_scenariofile.h:45
Definition sola_scenariofile.h:53
Definition sola_scenariofile.h:63
Definition sola_scenariofile.h:69
Definition sola_scenariofile.h:28
Definition sola_scenariofile.h:36