|
ROSE 2.23.0
|
holds data about all classes in a program
Definition at line 460 of file ClassHierarchyAnalysis.h.
#include <Rose/Common/Analysis/ClassHierarchyAnalysis.h>


Public Types | |
| using | base = ClassAnalysisBase |
| Base map type used for storage. | |
Public Member Functions | |
| ClassAnalysis (bool fullTranslUnit) | |
| Constructs an analysis and records whether it covers a complete translation unit. | |
| ClassAnalysis ()=default | |
| Constructs an empty analysis that does not claim complete-program coverage. | |
| void | addInheritanceEdge (value_type &descendant, ClassKeyType ancestorKey, bool isVirtual, bool isDirect) |
| convenience function to access the map using a SgClassDefinition reference. | |
| void | addInheritanceEdge (value_type &descendant, const InheritanceDesc &ancestor) |
adds an inheritance edge to the descendant class and ancestor class. | |
| bool | isBaseOf (ClassKeyType ancestorKey, ClassKeyType descendantKey) const |
returns true, iff ancestorKey is a (direct or indirect) base class of descendantKey. | |
| bool | isVirtualBaseOf (ClassKeyType ancestorKey, ClassKeyType descendantKey) const |
returns true, iff ancestorKey is a (direct or indirect) virtual base class of descendantKey. | |
| std::vector< InheritanceDesc > | concreteDescendants (ClassKeyType classKey) const |
returns a list of concrete descendant classes of classkey (i.e., const SgClassDefinition*) | |
| ClassAnalysisInfo | classInfo (ClassKeyType classKey) const |
| returns a ClassAnalysisInfo object that can be used for writing information to a stream. | |
| virtual const AbstractCompatibilityBridge & | compatibilityBridge () const =0 |
| Returns the frontend compatibility bridge associated with this analysis. | |
| mapped_type & | at (const key_type &k) |
replaces base::at with functions that can provide better diagnostics in case k is not known. | |
| const mapped_type & | at (const key_type &k) const |
replaces base::at with functions that can provide better diagnostics in case k is not known. | |
| bool | containsAllClasses () const |
| property indicating whether this analysis was built for the whole AST/program or just to represent the inheritance hierarchy of a single class. | |
| void | containsAllClasses (bool b) |
| property indicating whether this analysis was built for the whole AST/program or just to represent the inheritance hierarchy of a single class. | |
| using Rose::Common::Analysis::ClassAnalysis::base = ClassAnalysisBase |
Base map type used for storage.
Definition at line 465 of file ClassHierarchyAnalysis.h.
|
inlineexplicit |
Constructs an analysis and records whether it covers a complete translation unit.
| fullTranslUnit | true if the analysis covers the full translation unit. |
| languageVersion | language standard identifier used for language-specific rules. |
Definition at line 471 of file ClassHierarchyAnalysis.h.
| mapped_type & Rose::Common::Analysis::ClassAnalysis::at | ( | const key_type & | k | ) |
replaces base::at with functions that can provide better diagnostics in case k is not known.
| k | class key to look up. |
k. | const mapped_type & Rose::Common::Analysis::ClassAnalysis::at | ( | const key_type & | k | ) | const |
replaces base::at with functions that can provide better diagnostics in case k is not known.
| k | class key to look up. |
k. | void Rose::Common::Analysis::ClassAnalysis::addInheritanceEdge | ( | value_type & | descendant, |
| ClassKeyType | ancestorKey, | ||
| bool | isVirtual, | ||
| bool | isDirect | ||
| ) |
convenience function to access the map using a SgClassDefinition reference.
adds an inheritance edge to both classes descendant and ancestorKey
| descendant | the entry for the descendant class |
| ancestorKey | the key of the ancestor class |
| isVirtual | indicates if the inheritance is virtual |
| isDirect | indicates if descendant and ancestorKey are child and parent |
| void Rose::Common::Analysis::ClassAnalysis::addInheritanceEdge | ( | value_type & | descendant, |
| const InheritanceDesc & | ancestor | ||
| ) |
adds an inheritance edge to the descendant class and ancestor class.
| descendant | the entry for the descendant class. |
| ancestor | descriptor for the ancestor relationship to add. |
| bool Rose::Common::Analysis::ClassAnalysis::isBaseOf | ( | ClassKeyType | ancestorKey, |
| ClassKeyType | descendantKey | ||
| ) | const |
returns true, iff ancestorKey is a (direct or indirect) base class of descendantKey.
| ancestorKey | potential base class. |
| descendantKey | potential derived class. |
ancestorKey is a direct or indirect base of descendantKey.returns false when ancestorKey == descendantKey
| bool Rose::Common::Analysis::ClassAnalysis::isVirtualBaseOf | ( | ClassKeyType | ancestorKey, |
| ClassKeyType | descendantKey | ||
| ) | const |
returns true, iff ancestorKey is a (direct or indirect) virtual base class of descendantKey.
| ancestorKey | potential virtual base class. |
| descendantKey | potential derived class. |
ancestorKey is a direct or indirect virtual base of descendantKey. | std::vector< InheritanceDesc > Rose::Common::Analysis::ClassAnalysis::concreteDescendants | ( | ClassKeyType | classKey | ) | const |
returns a list of concrete descendant classes of classkey (i.e., const SgClassDefinition*)
| classKey | class whose descendants are requested. |
|
inline |
property indicating whether this analysis was built for the whole AST/program or just to represent the inheritance hierarchy of a single class.
| b | true if whole program, false otherwise |
Definition at line 548 of file ClassHierarchyAnalysis.h.
|
inline |
property indicating whether this analysis was built for the whole AST/program or just to represent the inheritance hierarchy of a single class.
| b | true if whole program, false otherwise |
Definition at line 549 of file ClassHierarchyAnalysis.h.
| ClassAnalysisInfo Rose::Common::Analysis::ClassAnalysis::classInfo | ( | ClassKeyType | classKey | ) | const |
returns a ClassAnalysisInfo object that can be used for writing information to a stream.
\begincode ClassAnalysis classAnalysis = ... ClassKeyType somekey = ... std::cout << classAnalysis.classInfo(someKey) << std::endl;
| classKey | class key to describe. |
classKey.
|
pure virtual |
Returns the frontend compatibility bridge associated with this analysis.
Implemented in Rose::BinaryAnalysis::ByteCode::ClassHierarchy::CilHierarchyAnalysis, Rose::BinaryAnalysis::ByteCode::ClassHierarchy::JvmHierarchyAnalysis, and Rose::Source::Analysis::CppHierarchyAnalysis.