diff options
author | Matt Spinler <spinler@us.ibm.com> | 2019-10-29 11:34:03 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2019-11-04 16:18:29 -0600 |
commit | 97d19b4806101161c5a97c1cc4daab6b95c89984 (patch) | |
tree | 4205a872c25082902a25cec74524aae58b7cf7de /extensions/openpower-pels/user_header.hpp | |
parent | da031717543b48a75e193d5e4d846a80279ca90b (diff) | |
download | phosphor-logging-97d19b4806101161c5a97c1cc4daab6b95c89984.tar.gz phosphor-logging-97d19b4806101161c5a97c1cc4daab6b95c89984.zip |
PEL: Const accessors for Private/UserHeader
Change the combined non-const accessor/setter functions for the
PrivateHeader and UserHeader fields to the standard const accessors, and
have separate setters for the fields that need to be modified.
In addition, make the 'get PrivateHeader' and 'get UserHeader' functions
on the PEL class return a const reference.
This allows const enforcement on the PEL class, for things like:
void func(const PEL& pel)
{
auto id = pel.privateHeader().id();
}
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I840170e72b41e9e2465f716617500269244de6d9
Diffstat (limited to 'extensions/openpower-pels/user_header.hpp')
-rw-r--r-- | extensions/openpower-pels/user_header.hpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/extensions/openpower-pels/user_header.hpp b/extensions/openpower-pels/user_header.hpp index c1b6636..459952b 100644 --- a/extensions/openpower-pels/user_header.hpp +++ b/extensions/openpower-pels/user_header.hpp @@ -64,9 +64,9 @@ class UserHeader : public Section /** * @brief Returns the subsystem field. * - * @return uint8_t& - the subsystem + * @return uint8_t - the subsystem */ - uint8_t& subsystem() + uint8_t subsystem() const { return _eventSubsystem; } @@ -74,9 +74,9 @@ class UserHeader : public Section /** * @brief Returns the event scope field. * - * @return uint8_t& - the event scope + * @return uint8_t - the event scope */ - uint8_t& scope() + uint8_t scope() const { return _eventScope; } @@ -84,9 +84,9 @@ class UserHeader : public Section /** * @brief Returns the severity field. * - * @return uint8_t& - the severity + * @return uint8_t - the severity */ - uint8_t& severity() + uint8_t severity() const { return _eventSeverity; } @@ -94,9 +94,9 @@ class UserHeader : public Section /** * @brief Returns the event type field. * - * @return uint8_t& - the event type + * @return uint8_t - the event type */ - uint8_t& eventType() + uint8_t eventType() const { return _eventType; } @@ -104,9 +104,9 @@ class UserHeader : public Section /** * @brief Returns the problem domain field. * - * @return uint8_t& - the problem domain + * @return uint8_t - the problem domain */ - uint8_t& problemDomain() + uint8_t problemDomain() const { return _problemDomain; } @@ -114,9 +114,9 @@ class UserHeader : public Section /** * @brief Returns the problem vector field. * - * @return uint8_t& - the problem vector + * @return uint8_t - the problem vector */ - uint8_t& problemVector() + uint8_t problemVector() const { return _problemVector; } @@ -124,9 +124,9 @@ class UserHeader : public Section /** * @brief Returns the action flags field. * - * @return uint16_t& - the action flags + * @return uint16_t - the action flags */ - uint16_t& actionFlags() + uint16_t actionFlags() const { return _actionFlags; } |