blob: ae4348f48350b1eae8674c1bbff02a9d14118d0d [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
kwibergad43d4b2017-09-05 08:38:22 -070011#ifndef WEBRTC_RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_
12#define WEBRTC_RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_
minyue939df962017-04-19 01:58:38 -070013
14#include <fstream>
15#include <string>
16
kwiberg84f6a3f2017-09-05 08:43:13 -070017#include "webrtc/api/optional.h"
Edward Lemurc20978e2017-07-06 19:44:34 +020018#include "webrtc/rtc_base/constructormagic.h"
minyue939df962017-04-19 01:58:38 -070019
Edward Lemurc20978e2017-07-06 19:44:34 +020020#include "webrtc/rtc_base/ignore_wundef.h"
minyue939df962017-04-19 01:58:38 -070021
22#ifdef WEBRTC_NETWORK_TESTER_PROTO
23RTC_PUSH_IGNORING_WUNDEF()
kjellanderd2b63cf2017-06-30 03:04:59 -070024#include "webrtc/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
kwibergad43d4b2017-09-05 08:38:22 -070053#endif // WEBRTC_RTC_TOOLS_NETWORK_TESTER_CONFIG_READER_H_