diff options
author | Patrick Venture <venture@google.com> | 2018-08-31 11:55:55 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-09-07 23:45:41 +0000 |
commit | 0b02be925a29357f69abbc9e9a58e7c5aaed2eab (patch) | |
tree | c1b39f817d98ffda7b987f9e3f864f576e3bf9ea /host-ipmid/oemrouter.hpp | |
parent | 26f80ab2cc41deadc913190d906f71266c4ed224 (diff) | |
download | phosphor-host-ipmid-0b02be925a29357f69abbc9e9a58e7c5aaed2eab.tar.gz phosphor-host-ipmid-0b02be925a29357f69abbc9e9a58e7c5aaed2eab.zip |
add .clang-format
Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'host-ipmid/oemrouter.hpp')
-rw-r--r-- | host-ipmid/oemrouter.hpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/host-ipmid/oemrouter.hpp b/host-ipmid/oemrouter.hpp index bc2b88c..d6f0735 100644 --- a/host-ipmid/oemrouter.hpp +++ b/host-ipmid/oemrouter.hpp @@ -12,38 +12,39 @@ namespace oem constexpr size_t groupMagicSize = 3; using Group = std::array<uint8_t, groupMagicSize>; -using Number = uint32_t; // smallest standard size >= 24. +using Number = uint32_t; // smallest standard size >= 24. // Handler signature includes ipmi cmd to support wildcard cmd match. // Buffers and lengths exclude the OemGroup bytes in the IPMI message. // dataLen supplies length of reqBuf upon call, and should be set to the // length of replyBuf upon return - conventional in this code base. -using Handler = std::function<ipmi_ret_t( - ipmi_cmd_t, // cmd byte - const uint8_t*, // reqBuf - uint8_t*, // replyBuf - size_t*)>; // dataLen +using Handler = std::function<ipmi_ret_t(ipmi_cmd_t, // cmd byte + const uint8_t*, // reqBuf + uint8_t*, // replyBuf + size_t*)>; // dataLen /// Router Interface class. /// @brief Abstract Router Interface class Router { - public: - virtual ~Router() {} + public: + virtual ~Router() + { + } - /// Enable message routing to begin. - virtual void activate() = 0; + /// Enable message routing to begin. + virtual void activate() = 0; - /// Register a handler for given OEMNumber & cmd. - /// Use IPMI_CMD_WILDCARD to catch any unregistered cmd - /// for the given OEMNumber. - /// - /// @param[in] oen - the OEM Number. - /// @param[in] cmd - the Command. - /// @param[in] handler - the handler to call given that OEN and - /// command. - virtual void registerHandler(Number oen, ipmi_cmd_t cmd, - Handler handler) = 0; + /// Register a handler for given OEMNumber & cmd. + /// Use IPMI_CMD_WILDCARD to catch any unregistered cmd + /// for the given OEMNumber. + /// + /// @param[in] oen - the OEM Number. + /// @param[in] cmd - the Command. + /// @param[in] handler - the handler to call given that OEN and + /// command. + virtual void registerHandler(Number oen, ipmi_cmd_t cmd, + Handler handler) = 0; }; /// Expose mutable Router for configuration & activation. @@ -75,9 +76,8 @@ constexpr Number toOemNumber(const Group& oeg) /// @return the OEM Group. constexpr Group toOemGroup(Number oen) { - return Group { static_cast<uint8_t>(oen), - static_cast<uint8_t>(oen >> 8), - static_cast<uint8_t>(oen >> 16) }; + return Group{static_cast<uint8_t>(oen), static_cast<uint8_t>(oen >> 8), + static_cast<uint8_t>(oen >> 16)}; } -} // namespace oem +} // namespace oem |