blob: f44e7a91f4566359cfc6e0a6c0149c544228ca12 [file] [log] [blame]
minyue939df962017-04-19 01:58:38 -07001/*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_
12#define RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_
minyue939df962017-04-19 01:58:38 -070013
14#include <fstream>
15#include <string>
16
Danil Chapovalov431abd92018-06-18 12:54:17 +020017#include "absl/types/optional.h"
Steve Anton10542f22019-01-11 09:11:00 -080018#include "rtc_base/constructor_magic.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "rtc_base/ignore_wundef.h"
minyue939df962017-04-19 01:58:38 -070020
21#ifdef WEBRTC_NETWORK_TESTER_PROTO
22RTC_PUSH_IGNORING_WUNDEF()
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020023#include "rtc_tools/network_tester/network_tester_config.pb.h"
minyue939df962017-04-19 01:58:38 -070024RTC_POP_IGNORING_WUNDEF()
25using webrtc::network_tester::config::NetworkTesterAllConfigs;
26#else
27class NetworkTesterConfigs;
28#endif // WEBRTC_NETWORK_TESTER_PROTO
29
30namespace webrtc {
31
32class ConfigReader {
33 public:
34 struct Config {
35 int packet_send_interval_ms;
36 int packet_size;
37 int execution_time_ms;
38 };
39 explicit ConfigReader(const std::string& config_file_path);
40 ~ConfigReader();
41
Danil Chapovalov431abd92018-06-18 12:54:17 +020042 absl::optional<Config> GetNextConfig();
minyue939df962017-04-19 01:58:38 -070043
44 private:
45 NetworkTesterAllConfigs proto_all_configs_;
46 int proto_config_index_;
47 RTC_DISALLOW_COPY_AND_ASSIGN(ConfigReader);
48};
49
50} // namespace webrtc
51
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020052#endif // RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_