Lines Matching +full:child +full:- +full:nodes
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
62 Trie() : nodes(1) {} in Trie()
69 optimizeNode(nodes[node.stringParamChild]); in optimizeNode()
73 optimizeNode(nodes[node.pathParamChild]); in optimizeNode()
86 Node& child = nodes[kv.second]; in optimizeNode() local
87 if (child.isSimpleNode()) in optimizeNode()
90 child.children) in optimizeNode()
110 optimizeNode(nodes[kv.second]); in optimizeNode()
132 const Node& child = nodes[kv.second]; in findRouteIndexesHelper() local
135 if (child.ruleIndex != 0 && fragment != "/") in findRouteIndexesHelper()
137 routeIndexes.push_back(child.ruleIndex); in findRouteIndexesHelper()
139 findRouteIndexesHelper(reqUrl, routeIndexes, child); in findRouteIndexesHelper()
146 routeIndexes, child); in findRouteIndexesHelper()
188 reqUrl.substr(epos), nodes[node.stringParamChild], params); in findHelper()
200 FindResult ret = findHelper("", nodes[node.pathParamChild], params); in findHelper()
211 const Node& child = nodes[kv.second]; in findHelper() local
216 findHelper(reqUrl.substr(fragment.size()), child, params); in findHelper()
254 Node& node = nodes[idx]; in add()
278 if (!nodes[idx].children.contains(piece)) in add()
281 nodes[idx].children.emplace(piece, newNodeIdx); in add()
283 idx = nodes[idx].children[piece]; in add()
286 Node& node = nodes[idx]; in add()
303 debugNodePrint(nodes[n.stringParamChild], level + 5); in debugNodePrint()
308 debugNodePrint(nodes[n.pathParamChild], level + 6); in debugNodePrint()
313 debugNodePrint(nodes[kv.second], level + kv.first.size()); in debugNodePrint()
326 return nodes.front(); in head()
331 return nodes.front(); in head()
336 nodes.resize(nodes.size() + 1); in newNode()
337 return static_cast<unsigned>(nodes.size() - 1); in newNode()
340 std::vector<Node> nodes; member in crow::Trie
425 trie.add(rule, static_cast<unsigned>(rules.size() - 1U)); in internalAdd()
430 trie.add(rule.substr(0, rule.size() - 1), in internalAdd()
431 static_cast<unsigned>(rules.size() - 1)); in internalAdd()
445 if ((ruleObject->methodsBitfield & methodBit) > 0U) in internalAddRuleObject()
451 if (ruleObject->isNotFound) in internalAddRuleObject()
456 if (ruleObject->isMethodNotAllowed) in internalAddRuleObject()
461 if (ruleObject->isUpgrade) in internalAddRuleObject()
473 std::unique_ptr<BaseRule> upgraded = rule->upgrade(); in validate()
478 rule->validate(); in validate()
479 internalAddRuleObject(rule->rule, rule.get()); in validate()
574 Trie::FindResult found = trie.find(req->url().encoded_path()); in handleUpgrade()
579 req->url().encoded_path()); in handleUpgrade()
580 asyncResp->res.result(boost::beast::http::status::not_found); in handleUpgrade()
615 req->url().encoded_path(), notFoundRoutes); in handle()
621 req->url().encoded_path(), methodNotAllowedRoutes); in handle()
628 asyncResp->res.addHeader(boost::beast::http::field::allow, in handle()
638 asyncResp->res.result(boost::beast::http::status::not_found); in handle()
642 asyncResp->res.result( in handle()
652 req->methodString(), rule.getMethods()); in handle()
654 if (req->session == nullptr) in handle()
685 ret.push_back(&pm.rules[index]->rule); in getRoutes()