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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual const char* type() const = 0; | 64 virtual const char* type() const = 0; |
65 // Returns a vector of pointers to all the |RTCStatsMemberInterface| members | 65 // Returns a vector of pointers to all the |RTCStatsMemberInterface| members |
66 // of this class. This allows for iteration of members. For a given class, | 66 // of this class. This allows for iteration of members. For a given class, |
67 // |Members| always returns the same members in the same order. | 67 // |Members| always returns the same members in the same order. |
68 std::vector<const RTCStatsMemberInterface*> Members() const; | 68 std::vector<const RTCStatsMemberInterface*> Members() const; |
69 // Checks if the two stats objects are of the same type and have the same | 69 // Checks if the two stats objects are of the same type and have the same |
70 // member values. These operators are exposed for testing. | 70 // member values. These operators are exposed for testing. |
71 bool operator==(const RTCStats& other) const; | 71 bool operator==(const RTCStats& other) const; |
72 bool operator!=(const RTCStats& other) const; | 72 bool operator!=(const RTCStats& other) const; |
73 | 73 |
74 // Creates a human readable string representation of the report, listing all | 74 // Creates a human readable string representation of the stats object, listing |
75 // of its members (names and values). | 75 // all of its members (names and values). |
76 std::string ToString() const; | 76 std::string ToString() const; |
77 | 77 |
78 // Downcasts the stats object to an |RTCStats| subclass |T|. DCHECKs that the | 78 // Downcasts the stats object to an |RTCStats| subclass |T|. DCHECKs that the |
79 // object is of type |T|. | 79 // object is of type |T|. |
80 template<typename T> | 80 template<typename T> |
81 const T& cast_to() const { | 81 const T& cast_to() const { |
82 RTC_DCHECK_EQ(type(), T::kType); | 82 RTC_DCHECK_EQ(type(), T::kType); |
83 return static_cast<const T&>(*this); | 83 return static_cast<const T&>(*this); |
84 } | 84 } |
85 | 85 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return &value_; | 313 return &value_; |
314 } | 314 } |
315 | 315 |
316 private: | 316 private: |
317 T value_; | 317 T value_; |
318 }; | 318 }; |
319 | 319 |
320 } // namespace webrtc | 320 } // namespace webrtc |
321 | 321 |
322 #endif // WEBRTC_API_STATS_RTCSTATS_H_ | 322 #endif // WEBRTC_API_STATS_RTCSTATS_H_ |
OLD | NEW |