blob: 9cca2fd47a5557844d263c110e99e7a831bdc369 [file] [log] [blame]
Matt Spinler2cfceb42018-04-23 11:13:04 -05001#pragma once
2
3#include "interfaces.hpp"
4#include "manager.hpp"
5
6namespace ibm
7{
8namespace logging
9{
10
11/**
12 * @class Delete
13 *
14 * Implements the xyz.openbmc_project.Collect.DeleteAll interface
15 * that will delete all ibm-logging entries.
16 */
17class DeleteAll : public DeleteAllObject
18{
19 public:
20 DeleteAll() = delete;
21 DeleteAll(const DeleteAll&) = delete;
22 DeleteAll& operator=(const DeleteAll&) = delete;
23 DeleteAll(DeleteAll&&) = default;
24 DeleteAll& operator=(DeleteAll&&) = default;
25 virtual ~DeleteAll() = default;
26
27 /**
28 * Constructor
29 *
30 * @param[in] bus - the D-Bus bus object
31 * @param[in] path - the object path
32 * @param[in] manager - the Manager object
33 */
34 DeleteAll(sdbusplus::bus::bus& bus, const std::string& path,
35 Manager& manager) :
36 DeleteAllObject(bus, path.c_str()),
37 manager(manager)
38 {
39 }
40
41 /**
42 * The Delete D-Bus method
43 */
44 inline void deleteAll() override
45 {
46 manager.eraseAll();
47 }
48
49 private:
50 /**
51 * The Manager object
52 */
53 Manager& manager;
54};
55}
56}