ROSE 0.11.145.147
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
8class ROSE_DLL_API ClassHierarchyWrapper
9{
10public:
11 typedef boost::unordered_set<SgClassDefinition*> ClassDefSet;
12
13 typedef boost::unordered_map<std::string, ClassDefSet> MangledNameToClassDefsMap;
14
15private:
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
34public:
35 explicit
37
38 const ClassDefSet& getSubclasses(SgClassDefinition *) const;
39 const ClassDefSet& getDirectSubclasses(SgClassDefinition *) const;
40 const ClassDefSet& getAncestorClasses(SgClassDefinition *) const;
41
42private:
43
47 static void buildAncestorsMap(const MangledNameToClassDefsMap& parents, MangledNameToClassDefsMap& transitiveParents);
48};
49
50
51#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.