CARMA C++
FaultUtils.h
1 /*
2  * Various Fault System Utilities
3  *
4  * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
5  */
6 
7 #ifndef FAULT_UTILS_H
8 #define FAULT_UTILS_H
9 
10 #include <carma/fault/DagMLNode.h>
11 
12 /*
13  * Populate @map recursively with certain types of nodes
14  *
15  * This performs a simple depth first search of @node, and inserts
16  * all nodes of @type into @map.
17  *
18  * @node: the start node
19  * @type: the type of node to insert into @map
20  * @map: the map of nodes
21  */
22 extern void populateNodeMapChecked(DagMLNodePtr node,
23  const enum DagMLNode::NodeTypes &type,
24  DagMLNodeMap &map);
25 
26 /*
27  * Find a node in @map by using the name only
28  *
29  * This performs a simple search of the map for the node, and returns
30  * the node if it is found, or NULL otherwise.
31  *
32  * @name: the name to find
33  * @map: the map to search
34  * @return: the node or NULL
35  */
36 extern DagMLNodePtr findNodeInMap(const std::string &name,
37  const DagMLNodeMap &map);
38 
39 /*
40  * Update and check all nodes in an entire DAG
41  *
42  * This performs a simple traversal of the the DAG tree, calling
43  * node->update() and then node->check() along the way.
44  *
45  * It DOES NOT make any attempt to track changes in the variable
46  * map or anything special like that: it just validates any static
47  * data.
48  */
49 extern void updateAndCheckDag(DagMLNodePtr node, const DagMLNodeUpdateInfo &info);
50 
51 #endif /* FAULT_UTILS_H */
52 
53 /* vim: set ts=8 sts=8 sw=8 noet tw=92: */