ROSE  0.11.96.11
ClassHierarchyGraph.h
1 #ifndef CLASS_HIERARCHY_GRAPH_H
2 #define CLASS_HIERARCHY_GRAPH_H
3 
4 #include <vector>
5 #include <map>
6 #include <boost/unordered_set.hpp>
7 
8 class ROSE_DLL_API ClassHierarchyWrapper
9 {
10 public:
11  typedef boost::unordered_set<SgClassDefinition*> ClassDefSet;
12 
13  typedef boost::unordered_map<std::string, ClassDefSet> MangledNameToClassDefsMap;
14 
15 private:
16 
17 
19  MangledNameToClassDefsMap directParents;
20 
22  MangledNameToClassDefsMap directChildren;
23 
25  MangledNameToClassDefsMap ancestorClasses;
26 
28  MangledNameToClassDefsMap subclasses;
29 
30 #if 0 // [Robb Matzke 2021-03-17]: unused
31  SgIncidenceDirectedGraph* classGraph;
32 #endif
33 
34 public:
35  explicit
37 
38  const ClassDefSet& getSubclasses(SgClassDefinition *) const;
39  const ClassDefSet& getDirectSubclasses(SgClassDefinition *) const;
40  const ClassDefSet& getAncestorClasses(SgClassDefinition *) const;
41 
42 private:
43 
47  static void buildAncestorsMap(const MangledNameToClassDefsMap& parents, MangledNameToClassDefsMap& transitiveParents);
48 };
49 
50 
51 #endif
SgClassDefinition
This class represents the concept of a class definition in C++.
Definition: Cxx_Grammar.h:127505
SgNode
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:6739
ClassHierarchyWrapper
Definition: ClassHierarchyGraph.h:8
SgIncidenceDirectedGraph
Definition: Cxx_Grammar.h:34205