xref: /openbmc/phosphor-objmgr/src/handler.hpp (revision d884cdf76957a2fce6c92d4c8bf0954c7a533998)
1aba14d3dSWilly Tu #pragma once
2aba14d3dSWilly Tu 
3aba14d3dSWilly Tu #include "types.hpp"
4aba14d3dSWilly Tu 
5aba14d3dSWilly Tu #include <string>
6aba14d3dSWilly Tu #include <vector>
7aba14d3dSWilly Tu 
8aba14d3dSWilly Tu void addObjectMapResult(std::vector<InterfaceMapType::value_type>& objectMap,
9aba14d3dSWilly Tu                         const std::string& objectPath,
10aba14d3dSWilly Tu                         const ConnectionNames::value_type& interfaceMap);
11aba14d3dSWilly Tu 
12*d884cdf7SPatrick Williams std::vector<InterfaceMapType::value_type> getAncestors(
13*d884cdf7SPatrick Williams     const InterfaceMapType& interfaceMap, std::string reqPath,
14aba14d3dSWilly Tu     std::vector<std::string>& interfaces);
15aba14d3dSWilly Tu 
16aba14d3dSWilly Tu ConnectionNames getObject(const InterfaceMapType& interfaceMap,
17aba14d3dSWilly Tu                           const std::string& path,
18aba14d3dSWilly Tu                           std::vector<std::string>& interfaces);
19aba14d3dSWilly Tu 
20*d884cdf7SPatrick Williams std::vector<InterfaceMapType::value_type> getSubTree(
21*d884cdf7SPatrick Williams     const InterfaceMapType& interfaceMap, std::string reqPath, int32_t depth,
22*d884cdf7SPatrick Williams     std::vector<std::string>& interfaces);
23aba14d3dSWilly Tu 
24*d884cdf7SPatrick Williams std::vector<std::string> getSubTreePaths(const InterfaceMapType& interfaceMap,
25*d884cdf7SPatrick Williams                                          std::string reqPath, int32_t depth,
26*d884cdf7SPatrick Williams                                          std::vector<std::string>& interfaces);
2758881d0bSWilly Tu 
2858881d0bSWilly Tu /**
2958881d0bSWilly Tu  * @brief Get the Associated Sub Tree object
3058881d0bSWilly Tu  *
3158881d0bSWilly Tu  * @param interfaceMap     Mapper Structure storing all associations
3258881d0bSWilly Tu  * @param associationMaps  Map of association between objects
3358881d0bSWilly Tu  * @param associationPath  Object path to get the endpoint from
3458881d0bSWilly Tu  * @param reqPath          Base path to search for the subtree
3558881d0bSWilly Tu  * @param depth            Level of depth to search into the base path
3658881d0bSWilly Tu  * @param interfaces       Interface filter
3758881d0bSWilly Tu  *
3858881d0bSWilly Tu  * Use getSubTree and return only the dbus objects that are in the endpoint
3958881d0bSWilly Tu  * of associationPath.
4058881d0bSWilly Tu  *
4158881d0bSWilly Tu  * @return std::vector<InterfaceMapType::value_type>
4258881d0bSWilly Tu  */
439052ebd3SPatrick Williams std::vector<InterfaceMapType::value_type> getAssociatedSubTree(
449052ebd3SPatrick Williams     const InterfaceMapType& interfaceMap,
4558881d0bSWilly Tu     const AssociationMaps& associationMaps,
4658881d0bSWilly Tu     const sdbusplus::message::object_path& associationPath,
479052ebd3SPatrick Williams     const sdbusplus::message::object_path& reqPath, int32_t depth,
489052ebd3SPatrick Williams     std::vector<std::string>& interfaces);
4958881d0bSWilly Tu 
5058881d0bSWilly Tu /**
5158881d0bSWilly Tu  * @brief Get the Associated Sub Tree Paths object
5258881d0bSWilly Tu  *
5358881d0bSWilly Tu  * @param interfaceMap     Mapper Structure storing all associations
5458881d0bSWilly Tu  * @param associationMaps  Map of association between objects
5558881d0bSWilly Tu  * @param associationPath  Object path to get the endpoint from
5658881d0bSWilly Tu  * @param reqPath          Base path to search for the subtree
5758881d0bSWilly Tu  * @param depth            Level of depth to search into the base path
5858881d0bSWilly Tu  * @param interfaces       Interface filter
5958881d0bSWilly Tu  *
6058881d0bSWilly Tu  * Use getSubTreePaths and return only the dbus objects that are in the
6158881d0bSWilly Tu  * endpoint of associationPath.
6258881d0bSWilly Tu  *
6358881d0bSWilly Tu  * @return std::vector<std::string>
6458881d0bSWilly Tu  */
6558881d0bSWilly Tu std::vector<std::string> getAssociatedSubTreePaths(
6658881d0bSWilly Tu     const InterfaceMapType& interfaceMap,
6758881d0bSWilly Tu     const AssociationMaps& associationMaps,
6858881d0bSWilly Tu     const sdbusplus::message::object_path& associationPath,
6958881d0bSWilly Tu     const sdbusplus::message::object_path& reqPath, int32_t depth,
7058881d0bSWilly Tu     std::vector<std::string>& interfaces);
71c363323eSLakshmi Yadlapati 
72c363323eSLakshmi Yadlapati /**
73c363323eSLakshmi Yadlapati  * @brief Get the Associated Sub Tree Paths object by id
74c363323eSLakshmi Yadlapati  *
75c363323eSLakshmi Yadlapati  * @param interfaceMap       Mapper Structure storing all associations
76c363323eSLakshmi Yadlapati  * @param associationMaps    Map of association between objects
77c363323eSLakshmi Yadlapati  * @param id                 Identifier to search for the subtree
78c363323eSLakshmi Yadlapati  * @param objectPath         Base path to search for the subtree
79c363323eSLakshmi Yadlapati  * @param subtreeInterfaces  Interface filter for the subtree
80c363323eSLakshmi Yadlapati  * @param association        The endpoint association
81c363323eSLakshmi Yadlapati  * @param endpointInterfaces Interface filter for the endpoint association
82c363323eSLakshmi Yadlapati  *
83c363323eSLakshmi Yadlapati  * Use getAssociatedSubTree and return only the dbus objects that
84c363323eSLakshmi Yadlapati  * are associated with the provided identifier, filtering based on on their
85c363323eSLakshmi Yadlapati  * endpoint association.
86c363323eSLakshmi Yadlapati  *
87c363323eSLakshmi Yadlapati  * @return std::vector<InterfaceMapType::value_type>
88c363323eSLakshmi Yadlapati  */
89c363323eSLakshmi Yadlapati std::vector<InterfaceMapType::value_type> getAssociatedSubTreeById(
90c363323eSLakshmi Yadlapati     const InterfaceMapType& interfaceMap,
91c363323eSLakshmi Yadlapati     const AssociationMaps& associationMaps, const std::string& id,
92c363323eSLakshmi Yadlapati     const std::string& objectPath, std::vector<std::string>& subtreeInterfaces,
93c363323eSLakshmi Yadlapati     const std::string& association,
94c363323eSLakshmi Yadlapati     std::vector<std::string>& endpointInterfaces);
95c363323eSLakshmi Yadlapati 
96c363323eSLakshmi Yadlapati /**
97c363323eSLakshmi Yadlapati  * @brief Get the Associated Sub Tree Paths object by id
98c363323eSLakshmi Yadlapati  *
99c363323eSLakshmi Yadlapati  * @param interfaceMap       Mapper Structure storing all associations
100c363323eSLakshmi Yadlapati  * @param associationMaps    Map of association between objects
101c363323eSLakshmi Yadlapati  * @param id                 Identifier to search for the subtree
102c363323eSLakshmi Yadlapati  * @param objectPath         Base path to search for the subtree
103c363323eSLakshmi Yadlapati  * @param subtreeInterfaces  Interface filter for the subtree
104c363323eSLakshmi Yadlapati  * @param association        The endpoint association
105c363323eSLakshmi Yadlapati  * @param endpointInterfaces Interface filter for the endpoint association
106c363323eSLakshmi Yadlapati  *
107c363323eSLakshmi Yadlapati  * Use getAssociatedSubTreePaths and return only the dbus objects that
108c363323eSLakshmi Yadlapati  * are associated with the provided identifier, filtering based on on their
109c363323eSLakshmi Yadlapati  * endpoint association.
110c363323eSLakshmi Yadlapati  *
111c363323eSLakshmi Yadlapati  * @return std::vector<std::string>
112c363323eSLakshmi Yadlapati  */
113c363323eSLakshmi Yadlapati std::vector<std::string> getAssociatedSubTreePathsById(
114c363323eSLakshmi Yadlapati     const InterfaceMapType& interfaceMap,
115c363323eSLakshmi Yadlapati     const AssociationMaps& associationMaps, const std::string& id,
116c363323eSLakshmi Yadlapati     const std::string& objectPath, std::vector<std::string>& subtreeInterfaces,
117c363323eSLakshmi Yadlapati     const std::string& association,
118c363323eSLakshmi Yadlapati     std::vector<std::string>& endpointInterfaces);
119