mirror of https://github.com/ARMmbed/mbed-os.git
BLE: expose representation type and pointer to the inner storage in SafeEnum.
parent
eda3bfb0e3
commit
ce2460a92a
|
@ -107,6 +107,10 @@ namespace ble {
|
|||
*/
|
||||
template<typename Target, typename LayoutType = unsigned int>
|
||||
struct SafeEnum {
|
||||
/**
|
||||
* Type of the representation.
|
||||
*/
|
||||
typedef LayoutType representation_t;
|
||||
|
||||
/**
|
||||
* Construction of an enumeration value.
|
||||
|
@ -197,6 +201,14 @@ struct SafeEnum {
|
|||
return _value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a pointer to the inner storage.
|
||||
*/
|
||||
const LayoutType* storage() const
|
||||
{
|
||||
return &_value;
|
||||
}
|
||||
|
||||
private:
|
||||
LayoutType _value;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue