ROSE  0.9.9.109
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  SgIncidenceDirectedGraph* classGraph;
31 
32 public:
33 
35  const ClassDefSet& getSubclasses(SgClassDefinition *) const;
36  const ClassDefSet& getDirectSubclasses(SgClassDefinition *) const;
37  const ClassDefSet& getAncestorClasses(SgClassDefinition *) const;
38 
39 private:
40 
44  static void buildAncestorsMap(const MangledNameToClassDefsMap& parents, MangledNameToClassDefsMap& transitiveParents);
45 };
46 
47 
48 #endif
This class represents the concept of a class definition in C++.
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:8322