blob: be3bcd5991c9ed1c6a9399a8a00ed0169a5c925b [file] [log] [blame]
Willy Tuaba14d32023-01-31 14:19:59 -08001#pragma once
2
3#include "types.hpp"
4
5#include <string>
6#include <vector>
7
8void addObjectMapResult(std::vector<InterfaceMapType::value_type>& objectMap,
9 const std::string& objectPath,
10 const ConnectionNames::value_type& interfaceMap);
11
Patrick Williamsd884cdf2025-02-01 08:23:38 -050012std::vector<InterfaceMapType::value_type> getAncestors(
13 const InterfaceMapType& interfaceMap, std::string reqPath,
14 std::vector<std::string>& interfaces);
Willy Tuaba14d32023-01-31 14:19:59 -080015
16ConnectionNames getObject(const InterfaceMapType& interfaceMap,
17 const std::string& path,
18 std::vector<std::string>& interfaces);
19
Patrick Williamsd884cdf2025-02-01 08:23:38 -050020std::vector<InterfaceMapType::value_type> getSubTree(
21 const InterfaceMapType& interfaceMap, std::string reqPath, int32_t depth,
22 std::vector<std::string>& interfaces);
Willy Tuaba14d32023-01-31 14:19:59 -080023
Patrick Williamsd884cdf2025-02-01 08:23:38 -050024std::vector<std::string> getSubTreePaths(const InterfaceMapType& interfaceMap,
25 std::string reqPath, int32_t depth,
26 std::vector<std::string>& interfaces);
Willy Tu58881d02022-10-02 20:46:45 +000027
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 */
Patrick Williams9052ebd2024-08-16 15:22:16 -040043std::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);
Willy Tu58881d02022-10-02 20:46:45 +000049
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 */
65std::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);
Lakshmi Yadlapatic3633232024-04-09 10:47:29 -050071
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 */
89std::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 */
113std::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);