xref: /openbmc/phosphor-objmgr/src/handler.hpp (revision cf72403d)
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>
25     getSubTreePaths(const InterfaceMapType& interfaceMap, std::string reqPath,
26                     int32_t depth, 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> getAssociatedSubTree(
44     const InterfaceMapType& interfaceMap,
45     const AssociationMaps& associationMaps,
46     const sdbusplus::message::object_path& associationPath,
47     const sdbusplus::message::object_path& reqPath, int32_t depth,
48     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 
72 /**
73  * @brief Get the Associated Sub Tree Paths object by id
74  *
75  * @param interfaceMap       Mapper Structure storing all associations
76  * @param associationMaps    Map of association between objects
77  * @param id                 Identifier to search for the subtree
78  * @param objectPath         Base path to search for the subtree
79  * @param subtreeInterfaces  Interface filter for the subtree
80  * @param association        The endpoint association
81  * @param endpointInterfaces Interface filter for the endpoint association
82  *
83  * Use getAssociatedSubTree and return only the dbus objects that
84  * are associated with the provided identifier, filtering based on on their
85  * endpoint association.
86  *
87  * @return std::vector<InterfaceMapType::value_type>
88  */
89 std::vector<InterfaceMapType::value_type> getAssociatedSubTreeById(
90     const InterfaceMapType& interfaceMap,
91     const AssociationMaps& associationMaps, const std::string& id,
92     const std::string& objectPath, std::vector<std::string>& subtreeInterfaces,
93     const std::string& association,
94     std::vector<std::string>& endpointInterfaces);
95 
96 /**
97  * @brief Get the Associated Sub Tree Paths object by id
98  *
99  * @param interfaceMap       Mapper Structure storing all associations
100  * @param associationMaps    Map of association between objects
101  * @param id                 Identifier to search for the subtree
102  * @param objectPath         Base path to search for the subtree
103  * @param subtreeInterfaces  Interface filter for the subtree
104  * @param association        The endpoint association
105  * @param endpointInterfaces Interface filter for the endpoint association
106  *
107  * Use getAssociatedSubTreePaths and return only the dbus objects that
108  * are associated with the provided identifier, filtering based on on their
109  * endpoint association.
110  *
111  * @return std::vector<std::string>
112  */
113 std::vector<std::string> getAssociatedSubTreePathsById(
114     const InterfaceMapType& interfaceMap,
115     const AssociationMaps& associationMaps, const std::string& id,
116     const std::string& objectPath, std::vector<std::string>& subtreeInterfaces,
117     const std::string& association,
118     std::vector<std::string>& endpointInterfaces);
119