OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 : id_(id), timestamp_us_(timestamp_us) {} | 53 : id_(id), timestamp_us_(timestamp_us) {} |
54 RTCStats(std::string&& id, int64_t timestamp_us) | 54 RTCStats(std::string&& id, int64_t timestamp_us) |
55 : id_(std::move(id)), timestamp_us_(timestamp_us) {} | 55 : id_(std::move(id)), timestamp_us_(timestamp_us) {} |
56 virtual ~RTCStats() {} | 56 virtual ~RTCStats() {} |
57 | 57 |
58 virtual std::unique_ptr<RTCStats> copy() const = 0; | 58 virtual std::unique_ptr<RTCStats> copy() const = 0; |
59 | 59 |
60 const std::string& id() const { return id_; } | 60 const std::string& id() const { return id_; } |
61 // Time relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds. | 61 // Time relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds. |
62 int64_t timestamp_us() const { return timestamp_us_; } | 62 int64_t timestamp_us() const { return timestamp_us_; } |
63 void set_timestamp_us_for_testing(int64_t timestamp_us) { | |
sakal
2017/02/03 15:13:02
I would rather just do a test for the qp_sum undef
hbos
2017/02/03 16:07:31
Oops, I actually don't need this, comparison opera
| |
64 timestamp_us_ = timestamp_us; | |
65 } | |
63 // Returns the static member variable |kType| of the implementing class. | 66 // Returns the static member variable |kType| of the implementing class. |
64 virtual const char* type() const = 0; | 67 virtual const char* type() const = 0; |
65 // Returns a vector of pointers to all the |RTCStatsMemberInterface| members | 68 // Returns a vector of pointers to all the |RTCStatsMemberInterface| members |
66 // of this class. This allows for iteration of members. For a given class, | 69 // of this class. This allows for iteration of members. For a given class, |
67 // |Members| always returns the same members in the same order. | 70 // |Members| always returns the same members in the same order. |
68 std::vector<const RTCStatsMemberInterface*> Members() const; | 71 std::vector<const RTCStatsMemberInterface*> Members() const; |
69 // Checks if the two stats objects are of the same type and have the same | 72 // Checks if the two stats objects are of the same type and have the same |
70 // member values. Timestamps are not compared. These operators are exposed for | 73 // member values. Timestamps are not compared. These operators are exposed for |
71 // testing. | 74 // testing. |
72 bool operator==(const RTCStats& other) const; | 75 bool operator==(const RTCStats& other) const; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 return &value_; | 319 return &value_; |
317 } | 320 } |
318 | 321 |
319 private: | 322 private: |
320 T value_; | 323 T value_; |
321 }; | 324 }; |
322 | 325 |
323 } // namespace webrtc | 326 } // namespace webrtc |
324 | 327 |
325 #endif // WEBRTC_API_STATS_RTCSTATS_H_ | 328 #endif // WEBRTC_API_STATS_RTCSTATS_H_ |
OLD | NEW |