pdr_utils.hpp (b426860708bb7bb7857c9d60c74a525f238f9393) pdr_utils.hpp (6492f524b7b2dfc9f04ee0ad68c4c2e35bbbcd25)
1#pragma once
2
1#pragma once
2
3#include "libpldm/pdr.h"
4
3#include "types.hpp"
4#include "utils.hpp"
5
6#include <stdint.h>
7
5#include "types.hpp"
6#include "utils.hpp"
7
8#include <stdint.h>
9
10#include <nlohmann/json.hpp>
11#include <xyz/openbmc_project/Common/error.hpp>
12
8#include <filesystem>
9#include <fstream>
10#include <functional>
11#include <iostream>
13#include <filesystem>
14#include <fstream>
15#include <functional>
16#include <iostream>
12#include <nlohmann/json.hpp>
13#include <string>
17#include <string>
14#include <xyz/openbmc_project/Common/error.hpp>
15
18
16#include "libpldm/pdr.h"
17
18using InternalFailure =
19 sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
20
21namespace fs = std::filesystem;
22
23namespace pldm
24{
25

--- 70 unchanged lines hidden (view full) ---

96 *
97 * @brief Abstract class describing the interface API to the PDR repository,
98 * this class wraps operations used to handle the new PDR APIs.
99 */
100class RepoInterface
101{
102 public:
103 RepoInterface(pldm_pdr* repo) : repo(repo)
19using InternalFailure =
20 sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
21
22namespace fs = std::filesystem;
23
24namespace pldm
25{
26

--- 70 unchanged lines hidden (view full) ---

97 *
98 * @brief Abstract class describing the interface API to the PDR repository,
99 * this class wraps operations used to handle the new PDR APIs.
100 */
101class RepoInterface
102{
103 public:
104 RepoInterface(pldm_pdr* repo) : repo(repo)
104 {
105 }
105 {}
106
107 virtual ~RepoInterface() = default;
108
109 /** @brief Get an opaque pldm_pdr structure
110 *
111 * @return pldm_pdr - pldm_pdr structure
112 */
113 virtual pldm_pdr* getPdr() const = 0;

--- 58 unchanged lines hidden (view full) ---

172 * Wrapper class to handle the PDR APIs
173 *
174 * This class wraps operations used to handle PDR APIs.
175 */
176class Repo : public RepoInterface
177{
178 public:
179 Repo(pldm_pdr* repo) : RepoInterface(repo)
106
107 virtual ~RepoInterface() = default;
108
109 /** @brief Get an opaque pldm_pdr structure
110 *
111 * @return pldm_pdr - pldm_pdr structure
112 */
113 virtual pldm_pdr* getPdr() const = 0;

--- 58 unchanged lines hidden (view full) ---

172 * Wrapper class to handle the PDR APIs
173 *
174 * This class wraps operations used to handle PDR APIs.
175 */
176class Repo : public RepoInterface
177{
178 public:
179 Repo(pldm_pdr* repo) : RepoInterface(repo)
180 {
181 }
180 {}
182
183 pldm_pdr* getPdr() const override;
184
185 RecordHandle addRecord(const PdrEntry& pdrEntry) override;
186
187 const pldm_pdr_record* getFirstRecord(PdrEntry& pdrEntry) override;
188
189 const pldm_pdr_record* getNextRecord(const pldm_pdr_record* currRecord,

--- 24 unchanged lines hidden ---
181
182 pldm_pdr* getPdr() const override;
183
184 RecordHandle addRecord(const PdrEntry& pdrEntry) override;
185
186 const pldm_pdr_record* getFirstRecord(PdrEntry& pdrEntry) override;
187
188 const pldm_pdr_record* getNextRecord(const pldm_pdr_record* currRecord,

--- 24 unchanged lines hidden ---