xref: /aosp_15_r20/external/webrtc/stats/test/rtc_test_stats.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright 2016 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 
11 #include "stats/test/rtc_test_stats.h"
12 
13 #include "rtc_base/checks.h"
14 
15 namespace webrtc {
16 
17 WEBRTC_RTCSTATS_IMPL(RTCTestStats,
18                      RTCStats,
19                      "test-stats",
20                      &m_bool,
21                      &m_int32,
22                      &m_uint32,
23                      &m_int64,
24                      &m_uint64,
25                      &m_double,
26                      &m_string,
27                      &m_sequence_bool,
28                      &m_sequence_int32,
29                      &m_sequence_uint32,
30                      &m_sequence_int64,
31                      &m_sequence_uint64,
32                      &m_sequence_double,
33                      &m_sequence_string,
34                      &m_map_string_uint64,
35                      &m_map_string_double)
36 
RTCTestStats(const std::string & id,int64_t timestamp_us)37 RTCTestStats::RTCTestStats(const std::string& id, int64_t timestamp_us)
38     : RTCStats(id, timestamp_us),
39       m_bool("mBool"),
40       m_int32("mInt32"),
41       m_uint32("mUint32"),
42       m_int64("mInt64"),
43       m_uint64("mUint64"),
44       m_double("mDouble"),
45       m_string("mString"),
46       m_sequence_bool("mSequenceBool"),
47       m_sequence_int32("mSequenceInt32"),
48       m_sequence_uint32("mSequenceUint32"),
49       m_sequence_int64("mSequenceInt64"),
50       m_sequence_uint64("mSequenceUint64"),
51       m_sequence_double("mSequenceDouble"),
52       m_sequence_string("mSequenceString"),
53       m_map_string_uint64("mMapStringUint64"),
54       m_map_string_double("mMapStringDouble") {}
55 
RTCTestStats(const RTCTestStats & other)56 RTCTestStats::RTCTestStats(const RTCTestStats& other)
57     : RTCStats(other.id(), other.timestamp_us()),
58       m_bool(other.m_bool),
59       m_int32(other.m_int32),
60       m_uint32(other.m_uint32),
61       m_int64(other.m_int64),
62       m_uint64(other.m_uint64),
63       m_double(other.m_double),
64       m_string(other.m_string),
65       m_sequence_bool(other.m_sequence_bool),
66       m_sequence_int32(other.m_sequence_int32),
67       m_sequence_uint32(other.m_sequence_uint32),
68       m_sequence_int64(other.m_sequence_int64),
69       m_sequence_uint64(other.m_sequence_uint64),
70       m_sequence_double(other.m_sequence_double),
71       m_sequence_string(other.m_sequence_string),
72       m_map_string_uint64(other.m_map_string_uint64),
73       m_map_string_double(other.m_map_string_double) {}
74 
~RTCTestStats()75 RTCTestStats::~RTCTestStats() {}
76 
77 }  // namespace webrtc
78