The Sparta Modeling Framework
Loading...
Searching...
No Matches
TreeUtils.hpp File Reference

File that defines hand sparta::TreeNode functions. More...

#include <string>
#include <cinttypes>
#include <vector>
#include "sparta/simulation/TreeNode.hpp"

Go to the source code of this file.

Namespaces

namespace  sparta
 Macros for handling exponential backoff.
 

Functions

uint64_t sparta::utils::recursiveTreeSearch (sparta::TreeNode *starting_node, const std::string &name, std::vector< sparta::TreeNode * > &found_nodes)
 Search a TreeNode for a given named node.
 

Detailed Description

File that defines hand sparta::TreeNode functions.

Definition in file TreeUtils.hpp.

Function Documentation

◆ recursiveTreeSearch()

uint64_t sparta::utils::recursiveTreeSearch ( sparta::TreeNode starting_node,
const std::string &  name,
std::vector< sparta::TreeNode * > &  found_nodes 
)

Search a TreeNode for a given named node.

Parameters
starting_nodeThe TreeNode to start the search. It's included in the search
nameThe TreeNode name to search for
RETURNEDfound_nodes Populated vector of nodes
Returns
Number of matches

An expensive, but thorough search starting at the given TreeNode for the nodes matching the given name. This method does not do pattern matching.

Note that the starting_node is not const as the intention of this call is to find those TreeNodes that might be modified

Definition at line 35 of file TreeUtils.hpp.

Here is the call graph for this function: