Lines Matching refs:Value
37 // Casts enum value to uint32_t.
41 // Returns uint32_t with one bit set at an index given by an enum value.
59 // Returns true if the uint32_t value of `val` is a bitwise subset of `mask`.
76 // Number of bits reserved for Value in dex flags, and the corresponding bit mask.
80 enum class Value : uint32_t {
113 static_assert(kValueBitSize >= MinimumBitsToStore(helper::ToUint(Value::kMax)),
117 static_assert(helper::MatchesBitMask(Value::kMin, kValueBitMask));
118 static_assert(helper::MatchesBitMask(Value::kMax, kValueBitMask));
120 // Assert that Value::kInvalid is larger than the maximum Value.
121 static_assert(helper::ToUint(Value::kMax) < helper::ToUint(Value::kInvalid));
137 // Maximum SDK versions allowed to access ApiList of given Value.
146 explicit ApiList(Value val, uint32_t domain_apis = 0u)
152 explicit ApiList(DomainApi val) : ApiList(Value::kInvalid, helper::ToBit(val)) {}
154 Value GetValue() const {
155 uint32_t value = (dex_flags_ & kValueBitMask);
157 // Treat all ones as invalid value
158 if (value == helper::ToUint(Value::kInvalid)) {
159 return Value::kInvalid;
161 DCHECK_GE(value, helper::ToUint(Value::kMin));
162 DCHECK_LE(value, helper::ToUint(Value::kMax));
163 return static_cast<Value>(value);
172 ApiList() : ApiList(Value::kInvalid) {}
179 static ApiList Whitelist() { return ApiList(Value::kWhitelist); }
180 static ApiList Greylist() { return ApiList(Value::kGreylist); }
181 static ApiList Blacklist() { return ApiList(Value::kBlacklist); }
182 static ApiList GreylistMaxO() { return ApiList(Value::kGreylistMaxO); }
183 static ApiList GreylistMaxP() { return ApiList(Value::kGreylistMaxP); }
187 uint32_t GetIntValue() const { return helper::ToUint(GetValue()) - helper::ToUint(Value::kMin); }
193 return ApiList(static_cast<Value>(i + helper::ToUint(Value::kMin)));
204 // Parses a vector of flag names into a single ApiList value. If successful,
234 const Value val1 = GetValue();
235 const Value val2 = other.GetValue();
236 return (val1 == val2) || (val1 == Value::kInvalid) || (val2 == Value::kInvalid);
244 // Values are mutually exclusive. Check if `this` and `other` have the same Value
246 const Value val1 = GetValue();
247 const Value val2 = other.GetValue();
250 } else if (val1 == Value::kInvalid) {
252 } else if (val2 == Value::kInvalid) {
268 return ((other.GetValue() == Value::kInvalid) || (GetValue() == other.GetValue())) &&
273 bool IsValid() const { return GetValue() != Value::kInvalid; }
276 bool IsEmpty() const { return (GetValue() == Value::kInvalid) && (GetDomainApis() == 0); }
284 if (GetValue() != Value::kInvalid) {
304 static constexpr uint32_t kValueCount = helper::NumValues<Value>();
308 inline std::ostream& operator<<(std::ostream& os, ApiList value) {
309 value.Dump(os);