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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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. Timestamps are not compared. These operators are exposed for | 70 // member values. Timestamps are not compared. These operators are exposed for |
71 // testing. | 71 // testing. |
72 bool operator==(const RTCStats& other) const; | 72 bool operator==(const RTCStats& other) const; |
73 bool operator!=(const RTCStats& other) const; | 73 bool operator!=(const RTCStats& other) const; |
74 | 74 |
75 // Creates a human readable string representation of the stats object, listing | 75 // Creates a human (and JSON) readable string representation of the stats |
76 // all of its members (names and values). | 76 // object, listing all of its members (names and values). |
77 std::string ToString() const; | 77 std::string ToString() const; |
hbos
2017/07/25 12:29:21
Let's rename it ToJson().
| |
78 | 78 |
79 // Downcasts the stats object to an |RTCStats| subclass |T|. DCHECKs that the | 79 // Downcasts the stats object to an |RTCStats| subclass |T|. DCHECKs that the |
80 // object is of type |T|. | 80 // object is of type |T|. |
81 template<typename T> | 81 template<typename T> |
82 const T& cast_to() const { | 82 const T& cast_to() const { |
83 RTC_DCHECK_EQ(type(), T::kType); | 83 RTC_DCHECK_EQ(type(), T::kType); |
84 return static_cast<const T&>(*this); | 84 return static_cast<const T&>(*this); |
85 } | 85 } |
86 | 86 |
87 protected: | 87 protected: |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 return &value_; | 316 return &value_; |
317 } | 317 } |
318 | 318 |
319 private: | 319 private: |
320 T value_; | 320 T value_; |
321 }; | 321 }; |
322 | 322 |
323 } // namespace webrtc | 323 } // namespace webrtc |
324 | 324 |
325 #endif // WEBRTC_API_STATS_RTCSTATS_H_ | 325 #endif // WEBRTC_API_STATS_RTCSTATS_H_ |
OLD | NEW |