diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2016-11-14 14:46:23 -0600 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-12-08 17:48:49 +0000 |
commit | 8f7941edf6843109d3da69900976b04b42d78aa4 (patch) | |
tree | 6b06f1b525f065772f75a2b0c0aa2d3fe99d36ed /xyz | |
parent | 88eb10904410567b290242daa338e5e3c13d0502 (diff) | |
download | phosphor-logging-8f7941edf6843109d3da69900976b04b42d78aa4.tar.gz phosphor-logging-8f7941edf6843109d3da69900976b04b42d78aa4.zip |
log_manager: Use sdbus++
Change-Id: Id2ad6a75b6ee3f7226c7cfd274dba24de89f9363
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'xyz')
-rw-r--r-- | xyz/openbmc_project/Logging/Internal/Manager/server.hpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/xyz/openbmc_project/Logging/Internal/Manager/server.hpp b/xyz/openbmc_project/Logging/Internal/Manager/server.hpp new file mode 100644 index 0000000..3bec2a9 --- /dev/null +++ b/xyz/openbmc_project/Logging/Internal/Manager/server.hpp @@ -0,0 +1,81 @@ +#pragma once +#include <tuple> +#include <systemd/sd-bus.h> +#include <sdbusplus/server.hpp> + +namespace sdbusplus +{ +namespace xyz +{ +namespace openbmc_project +{ +namespace Logging +{ +namespace Internal +{ +namespace server +{ + +class Manager +{ + public: + /* Define all of the basic class operations: + * Not allowed: + * - Default constructor to avoid nullptrs. + * - Copy operations due to internal unique_ptr. + * Allowed: + * - Move operations. + * - Destructor. + */ + Manager() = delete; + Manager(const Manager&) = delete; + Manager& operator=(const Manager&) = delete; + Manager(Manager&&) = default; + Manager& operator=(Manager&&) = default; + virtual ~Manager() = default; + + /** @brief Constructor to put object onto bus at a dbus path. + * @param[in] bus - Bus to attach to. + * @param[in] path - Path to attach at. + */ + Manager(bus::bus& bus, const char* path); + + + + /** @brief Implementation for Commit + * Write the requested error/event entry with its associated metadata fields to flash. + * + * @param[in] transactionId - The unique identifier of the journal entry(ies) to be committed. + * @param[in] errMsg - The error exception message associated with the error event log to be committed. + */ + virtual void commit( + uint64_t transactionId, + std::string errMsg) = 0; + + + + + private: + + /** @brief sd-bus callback for Commit + */ + static int _callback_Commit( + sd_bus_message*, void*, sd_bus_error*); + + + static constexpr auto _interface = "xyz.openbmc_project.Logging.Internal.Manager"; + static const vtable::vtable_t _vtable[]; + sdbusplus::server::interface::interface + _xyz_openbmc_project_Logging_Internal_Manager_interface; + + +}; + + +} // namespace server +} // namespace Internal +} // namespace Logging +} // namespace openbmc_project +} // namespace xyz +} // namespace sdbusplus + |