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>
|
template<typename Target, typename LayoutType = unsigned int>
|
||||||
struct SafeEnum {
|
struct SafeEnum {
|
||||||
|
/**
|
||||||
|
* Type of the representation.
|
||||||
|
*/
|
||||||
|
typedef LayoutType representation_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construction of an enumeration value.
|
* Construction of an enumeration value.
|
||||||
|
@ -197,6 +201,14 @@ struct SafeEnum {
|
||||||
return _value;
|
return _value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a pointer to the inner storage.
|
||||||
|
*/
|
||||||
|
const LayoutType* storage() const
|
||||||
|
{
|
||||||
|
return &_value;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LayoutType _value;
|
LayoutType _value;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue