xref: /openbmc/phosphor-objmgr/src/handler.hpp (revision 3e2eb6af)
1 #pragma once
2 
3 #include "types.hpp"
4 
5 #include <string>
6 #include <vector>
7 
8 void addObjectMapResult(std::vector<InterfaceMapType::value_type>& objectMap,
9                         const std::string& objectPath,
10                         const ConnectionNames::value_type& interfaceMap);
11 
12 std::vector<InterfaceMapType::value_type>
13     getAncestors(const InterfaceMapType& interfaceMap, std::string reqPath,
14                  std::vector<std::string>& interfaces);
15 
16 ConnectionNames getObject(const InterfaceMapType& interfaceMap,
17                           const std::string& path,
18                           std::vector<std::string>& interfaces);
19 
20 std::vector<InterfaceMapType::value_type>
21     getSubTree(const InterfaceMapType& interfaceMap, std::string reqPath,
22                int32_t depth, std::vector<std::string>& interfaces);
23 
24 std::vector<std::string> getSubTreePaths(const InterfaceMapType& interfaceMap,
25                                          std::string reqPath, int32_t depth,
26                                          std::vector<std::string>& interfaces);
27 
28 /**
29  * @brief Get the Associated Sub Tree object
30  *
31  * @param interfaceMap     Mapper Structure storing all associations
32  * @param associationMaps  Map of association between objects
33  * @param associationPath  Object path to get the endpoint from
34  * @param reqPath          Base path to search for the subtree
35  * @param depth            Level of depth to search into the base path
36  * @param interfaces       Interface filter
37  *
38  * Use getSubTree and return only the dbus objects that are in the endpoint
39  * of associationPath.
40  *
41  * @return std::vector<InterfaceMapType::value_type>
42  */
43 std::vector<InterfaceMapType::value_type>
44     getAssociatedSubTree(const InterfaceMapType& interfaceMap,
45                          const AssociationMaps& associationMaps,
46                          const sdbusplus::message::object_path& associationPath,
47                          const sdbusplus::message::object_path& reqPath,
48                          int32_t depth, std::vector<std::string>& interfaces);
49 
50 /**
51  * @brief Get the Associated Sub Tree Paths object
52  *
53  * @param interfaceMap     Mapper Structure storing all associations
54  * @param associationMaps  Map of association between objects
55  * @param associationPath  Object path to get the endpoint from
56  * @param reqPath          Base path to search for the subtree
57  * @param depth            Level of depth to search into the base path
58  * @param interfaces       Interface filter
59  *
60  * Use getSubTreePaths and return only the dbus objects that are in the
61  * endpoint of associationPath.
62  *
63  * @return std::vector<std::string>
64  */
65 std::vector<std::string> getAssociatedSubTreePaths(
66     const InterfaceMapType& interfaceMap,
67     const AssociationMaps& associationMaps,
68     const sdbusplus::message::object_path& associationPath,
69     const sdbusplus::message::object_path& reqPath, int32_t depth,
70     std::vector<std::string>& interfaces);
71