webrtc_m130/stats/rtc_stats_member.cc
Henrik Boström fd54a619a5 Revert "[Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>."
This reverts commit 79ac694d9b70fa9cd7b6a0f00bbee5d7fbbe64de.

Reason for revert: Breaks downstream (found another use of
ValueOrDefault instead of value_or)...

Original change's description:
> [Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>.
>
> The moment we've all been waiting for.
>
> Step 1: Add type alias (this CL).
> Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
> Step 3: Delete type alias.
>
> Bug: webrtc:15164
> Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41593}

Bug: webrtc:15164
Change-Id: Ice3f44057b82a7ba9be000d9a0b714152fd07d2f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335701
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Christoffer Dewerin <jansson@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41595}
2024-01-22 15:40:52 +00:00

63 lines
3.0 KiB
C++

/*
* Copyright 2023 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/stats/rtc_stats_member.h"
namespace webrtc {
#define WEBRTC_DEFINE_RTCSTATSMEMBER(T, type, is_seq, is_str) \
template <> \
RTCStatsMemberInterface::Type RTCStatsMember<T>::StaticType() { \
return type; \
} \
template <> \
bool RTCStatsMember<T>::is_sequence() const { \
return is_seq; \
} \
template <> \
bool RTCStatsMember<T>::is_string() const { \
return is_str; \
} \
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) RTCStatsMember<T>
WEBRTC_DEFINE_RTCSTATSMEMBER(bool, kBool, false, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(int32_t, kInt32, false, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(uint32_t, kUint32, false, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(int64_t, kInt64, false, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(uint64_t, kUint64, false, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(double, kDouble, false, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::string, kString, false, true);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<bool>, kSequenceBool, true, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<int32_t>, kSequenceInt32, true, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<uint32_t>,
kSequenceUint32,
true,
false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<int64_t>, kSequenceInt64, true, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<uint64_t>,
kSequenceUint64,
true,
false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<double>, kSequenceDouble, true, false);
WEBRTC_DEFINE_RTCSTATSMEMBER(std::vector<std::string>,
kSequenceString,
true,
false);
WEBRTC_DEFINE_RTCSTATSMEMBER(rtc_stats_internal::MapStringUint64,
kMapStringUint64,
false,
false);
WEBRTC_DEFINE_RTCSTATSMEMBER(rtc_stats_internal::MapStringDouble,
kMapStringDouble,
false,
false);
} // namespace webrtc