Skip to content

Commit

Permalink
Add common/h/Graph.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent c885379 commit 5a433b0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions common/h/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

// Graph class


#if !defined(GRAPH_H)
#define GRAPH_H

Expand Down Expand Up @@ -84,28 +81,22 @@ class COMMON_EXPORT Graph : public AnnotatableSparse {
};

typedef bool (*NodePredicateFunc)(const NodePtr &node, void *user_arg);

// If you want to traverse the graph start here.

virtual void entryNodes(NodeIterator &begin, NodeIterator &end);

// If you want to traverse the graph backwards start here.
virtual void exitNodes(NodeIterator &begin, NodeIterator &end);

// Get all nodes in the graph
virtual void allNodes(NodeIterator &begin, NodeIterator &end);

// Get all nodes with a provided address
virtual bool find(Address addr, NodeIterator &begin, NodeIterator &end);

// Get all nodes that satisfy the provided predicate
virtual bool find(NodePredicate::Ptr, NodeIterator &begin, NodeIterator &end);
virtual bool find(NodePredicateFunc, void *user_arg, NodeIterator &begin, NodeIterator &end);

bool printDOT(const std::string& fileName);

virtual ~Graph() {}

// We create an empty graph and then add nodes and edges.
static Ptr createGraph();

void insertPair(NodePtr source, NodePtr target, EdgePtr edge = EdgePtr());
Expand Down

0 comments on commit 5a433b0

Please sign in to comment.