blob: e03317fe4304bbf006d32a62e3e7dc533be96074 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "api/optional.h"
18#include "rtc_base/constructormagic.h"
minyue939df962017-04-19 01:58:38 -070019
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#include "rtc_base/ignore_wundef.h"
minyue939df962017-04-19 01:58:38 -070021
22#ifdef WEBRTC_NETWORK_TESTER_PROTO
23RTC_PUSH_IGNORING_WUNDEF()
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020024#include "rtc_tools/network_tester/network_tester_config.pb.h"
minyue939df962017-04-19 01:58:38 -070025RTC_POP_IGNORING_WUNDEF()
26using webrtc::network_tester::config::NetworkTesterAllConfigs;
27#else
28class NetworkTesterConfigs;
29#endif // WEBRTC_NETWORK_TESTER_PROTO
30
31namespace webrtc {
32
33class ConfigReader {
34 public:
35 struct Config {
36 int packet_send_interval_ms;
37 int packet_size;
38 int execution_time_ms;
39 };
40 explicit ConfigReader(const std::string& config_file_path);
41 ~ConfigReader();
42
43 rtc::Optional<Config> GetNextConfig();
44
45 private:
46 NetworkTesterAllConfigs proto_all_configs_;
47 int proto_config_index_;
48 RTC_DISALLOW_COPY_AND_ASSIGN(ConfigReader);
49};
50
51} // namespace webrtc
52
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020053#endif // RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_