SunnySrivastava1984 | c743d82 | 2020-04-27 05:49:22 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
SunnySrivastava1984 | bca5aaa | 2020-04-21 05:31:04 -0500 | [diff] [blame] | 3 | #include "types.hpp" |
| 4 | |
SunnySrivastava1984 | c743d82 | 2020-04-27 05:49:22 -0500 | [diff] [blame] | 5 | namespace openpower |
| 6 | { |
| 7 | namespace vpd |
| 8 | { |
| 9 | namespace manager |
| 10 | { |
| 11 | namespace reader |
| 12 | { |
| 13 | |
| 14 | /** @class ReaderImpl |
| 15 | * @brief Implements functionalities related to reading of VPD related data |
| 16 | * from the system. |
SunnySrivastava1984 | c743d82 | 2020-04-27 05:49:22 -0500 | [diff] [blame] | 17 | */ |
| 18 | class ReaderImpl |
| 19 | { |
| 20 | public: |
| 21 | ReaderImpl() = default; |
| 22 | ReaderImpl(const ReaderImpl&) = delete; |
| 23 | ReaderImpl& operator=(const ReaderImpl&) = delete; |
| 24 | ReaderImpl(ReaderImpl&&) = delete; |
| 25 | ReaderImpl& operator=(ReaderImpl&&) = delete; |
| 26 | ~ReaderImpl() = default; |
SunnySrivastava1984 | bca5aaa | 2020-04-21 05:31:04 -0500 | [diff] [blame] | 27 | |
| 28 | /** @brief An API to expand a given unexpanded location code. |
| 29 | * @param[in] locationCode - unexpanded location code. |
| 30 | * @param[in] nodeNumber - node on which we are looking for location code. |
| 31 | * @param[in] frusLocationCode - mapping of inventory path and location |
| 32 | * code. |
| 33 | * @return Expanded location code. |
| 34 | */ |
| 35 | std::string getExpandedLocationCode( |
| 36 | const std::string& locationCode, const uint16_t& nodeNumber, |
| 37 | const inventory::LocationCodeMap& frusLocationCode) const; |
| 38 | |
SunnySrivastava1984 | 1356d7e | 2020-04-24 04:29:35 -0500 | [diff] [blame^] | 39 | /** @brief An api to get list of all the FRUs at the given location code |
| 40 | * @param[in] - location code in unexpanded format |
| 41 | * @param[in] - node number |
| 42 | * @param[in] - mapping of location code and Inventory path |
| 43 | * @return list of Inventory paths at the given location |
| 44 | */ |
| 45 | inventory::ListOfPaths getFrusAtLocation( |
| 46 | const std::string& locationCode, const uint16_t& nodeNumber, |
| 47 | const inventory::LocationCodeMap& frusLocationCode) const; |
| 48 | |
| 49 | private: |
| 50 | /** @brief An api to check validity of location code |
| 51 | * @param[in] - location code |
| 52 | * @return true/false based on validity check |
| 53 | */ |
| 54 | bool isValidLocationCode(const std::string& locationCode) const; |
| 55 | |
SunnySrivastava1984 | c743d82 | 2020-04-27 05:49:22 -0500 | [diff] [blame] | 56 | }; // class ReaderImpl |
| 57 | |
| 58 | } // namespace reader |
| 59 | } // namespace manager |
| 60 | } // namespace vpd |
SunnySrivastava1984 | 1356d7e | 2020-04-24 04:29:35 -0500 | [diff] [blame^] | 61 | } // namespace openpower |