5#ifndef FLUTTER_IMPELLER_BASE_COMPARABLE_H_
6#define FLUTTER_IMPELLER_BASE_COMPARABLE_H_
22 return id == other.
id;
38 class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>
40 std::size_t
operator()(
const ComparableType&
object)
const {
41 return object.GetHash();
47 class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>
49 bool operator()(
const ComparableType& lhs,
const ComparableType& rhs)
const {
50 return lhs.IsEqual(rhs);
56 class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>
58 const std::shared_ptr<ComparableType>& rhs) {
64 return lhs->IsEqual(*rhs);
73 class = std::enable_if_t<std::is_base_of_v<ComparableBase, ComparableType>>>
75 const std::map<
Key, std::shared_ptr<ComparableType>>& rhs) {
76 if (lhs.size() != rhs.size()) {
80 for (
auto i = lhs.begin(), j = rhs.begin();
i != lhs.end();
i++, j++) {
81 if (
i->first != j->first) {
108 return lhs.
id < rhs.
id;
static uint32_t hash(const SkShaderBase::GradientInfo &v)
virtual bool IsEqual(const Type &other) const =0
virtual std::size_t GetHash() const =0
bool DeepComparePointer(const std::shared_ptr< ComparableType > &lhs, const std::shared_ptr< ComparableType > &rhs)
bool DeepCompareMap(const std::map< Key, std::shared_ptr< ComparableType > > &lhs, const std::map< Key, std::shared_ptr< ComparableType > > &rhs)
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
bool operator()(const ComparableType &lhs, const ComparableType &rhs) const
std::size_t operator()(const ComparableType &object) const
constexpr bool operator==(const UniqueID &other) const
constexpr std::size_t operator()(const impeller::UniqueID &id)
constexpr bool operator()(const impeller::UniqueID &lhs, const impeller::UniqueID &rhs) const