|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
A proxy for this Field within the Bitpack's Storage. More...
#include <bitpack.hh>
Public Types | |
| using | Field = Field |
| Name the Field of which we are a proxy. | |
| using | RefType = RefTypeParam |
| Expose the qualified reference type we hold to the Storage. | |
Public Member Functions | |
| template<typename R> | |
| constexpr | Proxy (R &r) |
| Construct a proxy given a reference to the storage word. | |
| template<typename Self> requires ( !std::is_const_v<std::remove_reference_t<RefTypeParam>>) | |
| constexpr Self && | operator= (this Self &&self, Field::Type rhs) |
| Compute and store an updated Bitpack value with a new value for this field (of the field type itself). | |
| template<typename Self, typename RHS> requires ( !std::is_const_v<std::remove_reference_t<RefTypeParam>> && std::is_same_v<Field::Type, Numeric<RHS>>) | |
| constexpr Self && | operator= (this Self &&self, RHS rhs) |
| Compute and store an updated Bitpack value with a new value for this field, when this field's type is a Numeric wrapper, and the RHS is the underlying type inside the Numeric wrapper. | |
| template<typename Self, typename RHS> requires ( !std::is_const_v<std::remove_reference_t<RefTypeParam>> && std::is_scoped_enum_v<Field::Type> && std::is_same_v <std::underlying_type_t<Field::Type>, RHS>) | |
| constexpr Self && | operator= (this Self &&self, RHS rhs) |
| Compute and store an updated Bitpack value with a new value for this field, when this field's type is an enum class and the RHS is the underlying type of that enum. | |
| template<typename Self> requires ( !std::is_volatile_v<std::remove_reference_t<RefTypeParam>>) | |
| constexpr | operator Field::Type (this Self &&self) |
| Explicit conversion of a Field::Proxy to the field value. | |
| constexpr Field::Type | raw () const |
| A shorter way of spelling static_cast<Field::Type>()... | |
| constexpr auto | rawer () const |
| Get the value of this enum-typed field as its underlying type. | |
| constexpr auto | rawer () const |
| Get the value of this Numeric-typed field as its underlying type. | |
| constexpr DerivedBitpack | with (Field::Type rhs) const |
| Construct a new Bitpack value with an updated value of this field. | |
| constexpr DerivedBitpack | with (auto &&f) const |
| Construct a new Bitpack value with an updated value of this field as a function of its current value. | |
| template<typename Self> requires ( std:: is_invocable_r_v<Field::Type, decltype(f), Field::Type> && !std::is_const_v<std::remove_reference_t<RefTypeParam>>) | |
| constexpr void | alter (this Self &&self, auto &&f) |
| Compute and store an updated Bitpack value with a new value for this field as a function of its current value. | |
| constexpr void | assign_from (auto &&f) |
| Convenience function for unconditionally assigning a field when it helps to have a zero value of that field's type. | |
| constexpr auto | operator<=> (Proxy rhs) const |
| constexpr auto | operator<=> (Field::Type rhs) const |
| constexpr bool | operator== (Proxy rhs) const |
| constexpr bool | operator== (Field::Type rhs) const |
A proxy for this Field within the Bitpack's Storage.
This provides getters, setters, and mutators phrased in terms of the Field's exposed Type rather than the raw bits within the Bitpack's underlying Storage word.
Proxies are templated on their containing derived type (so that they can act "in situ" in the class hierarchy, consuming and returning the same type, which must have Bitpack as its base type) and the type of the reference they hold to their containing Bitpack's underlying Storage word (so that they can properly propagate volatile and const qualifications from the Bitpack value and the Field's properties to perceived type).
Definition at line 568 of file bitpack.hh.
| using Bitpack< StorageParam >::Field< TypeParam, InfoParam >::Proxy< DerivedBitpack, RefTypeParam >::Field = Field |
Name the Field of which we are a proxy.
Definition at line 575 of file bitpack.hh.
| using Bitpack< StorageParam >::Field< TypeParam, InfoParam >::Proxy< DerivedBitpack, RefTypeParam >::RefType = RefTypeParam |
Expose the qualified reference type we hold to the Storage.
Definition at line 578 of file bitpack.hh.
|
inlineconstexpr |
Construct a proxy given a reference to the storage word.
May take any reference type implicitly convertible to RefType, not just RefType itself.
Definition at line 587 of file bitpack.hh.
|
inlineconstexpr |
Compute and store an updated Bitpack value with a new value for this field as a function of its current value.
For volatile Bitpacks, this will perform a load and store.
Definition at line 723 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_view(), and Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().
|
inlineconstexpr |
Convenience function for unconditionally assigning a field when it helps to have a zero value of that field's type.
Use .alter() if the current value of the field is required.
Because this requires a read of the whole Bitpack to update, we refuse to operate on volatile values, and because it's an assignment, we don't operate on const values either.
Definition at line 743 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_view(), and Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().
|
inlineconstexpr |
Explicit conversion of a Field::Proxy to the field value.
The Proxy must not have a volatile reference to Storage. Use .read() on the containing Bitpack, first.
Definition at line 653 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_view().
Referenced by rawer().
|
inlineconstexpr |
Definition at line 758 of file bitpack.hh.
|
inlineconstexpr |
Definition at line 750 of file bitpack.hh.
|
inlineconstexpr |
Compute and store an updated Bitpack value with a new value for this field (of the field type itself).
For volatile Bitpacks, this will perform a load and store.
Definition at line 601 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().
|
inlineconstexpr |
Compute and store an updated Bitpack value with a new value for this field, when this field's type is an enum class and the RHS is the underlying type of that enum.
For volatile Bitpacks, this will perform a load and store.
Definition at line 638 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().
|
inlineconstexpr |
Compute and store an updated Bitpack value with a new value for this field, when this field's type is a Numeric wrapper, and the RHS is the underlying type inside the Numeric wrapper.
For volatile Bitpacks, this will perform a load and store.
Definition at line 619 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().
|
inlineconstexpr |
Definition at line 774 of file bitpack.hh.
|
inlineconstexpr |
Definition at line 766 of file bitpack.hh.
|
inlinenodiscardconstexpr |
A shorter way of spelling static_cast<Field::Type>()...
Definition at line 659 of file bitpack.hh.
Referenced by rawer().
|
inlinenodiscardconstexpr |
Get the value of this Numeric-typed field as its underlying type.
Definition at line 674 of file bitpack.hh.
References operator Field::Type(), and raw().
|
inlinenodiscardconstexpr |
Get the value of this enum-typed field as its underlying type.
Definition at line 665 of file bitpack.hh.
References operator Field::Type(), and raw().
|
inlineconstexpr |
Construct a new Bitpack value with an updated value of this field as a function of its current value.
This is emphatically not volatile-qualified, and has no volatile-qualified overload. .read() the containing Bitpack, first.
Definition at line 704 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_view(), and Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().
|
inlinenodiscardconstexpr |
Construct a new Bitpack value with an updated value of this field.
This is emphatically not volatile-qualified, and has no volatile-qualified overload. .read() the containing Bitpack, first.
Definition at line 691 of file bitpack.hh.
References Bitpack< StorageParam >::Field< TypeParam, InfoParam >::raw_with().