blob: 6ac12e5ae56eceb3ffeb2e0bf0955de53ff245a5 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: public_member_api_docs
// Bits represents a bit field, i.e. no bit set, one bit set, or multiple bit
// set.
abstract class Bits {
const Bits();
int get $value;
@override
bool operator ==(dynamic other) {
if (other is Bits) {
return $value == other.$value;
}
return false;
}
@override
int get hashCode => $value.hashCode;
}
typedef BitsFactory<T> = T Function(int value);