ROSE 2.23.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Rose::Common::Analysis::ClassAnalysis Class Referenceabstract

Description

holds data about all classes in a program

Definition at line 460 of file ClassHierarchyAnalysis.h.

#include <Rose/Common/Analysis/ClassHierarchyAnalysis.h>

Inheritance diagram for Rose::Common::Analysis::ClassAnalysis:
Inheritance graph
[legend]
Collaboration diagram for Rose::Common::Analysis::ClassAnalysis:
Collaboration graph
[legend]

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.
 

Member Typedef Documentation

◆ base

Base map type used for storage.

Definition at line 465 of file ClassHierarchyAnalysis.h.

Constructor & Destructor Documentation

◆ ClassAnalysis()

Rose::Common::Analysis::ClassAnalysis::ClassAnalysis ( bool  fullTranslUnit)
inlineexplicit

Constructs an analysis and records whether it covers a complete translation unit.

Parameters
fullTranslUnittrue if the analysis covers the full translation unit.
languageVersionlanguage standard identifier used for language-specific rules.

Definition at line 471 of file ClassHierarchyAnalysis.h.

Member Function Documentation

◆ at() [1/2]

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.

Parameters
kclass key to look up.
Returns
mutable or const class data for k.

◆ at() [2/2]

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.

Parameters
kclass key to look up.
Returns
mutable or const class data for k.

◆ addInheritanceEdge() [1/2]

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

Parameters
descendantthe entry for the descendant class
ancestorKeythe key of the ancestor class
isVirtualindicates if the inheritance is virtual
isDirectindicates if descendant and ancestorKey are child and parent
Returns
nothing.

◆ addInheritanceEdge() [2/2]

void Rose::Common::Analysis::ClassAnalysis::addInheritanceEdge ( value_type &  descendant,
const InheritanceDesc &  ancestor 
)

adds an inheritance edge to the descendant class and ancestor class.

Parameters
descendantthe entry for the descendant class.
ancestordescriptor for the ancestor relationship to add.
Returns
nothing.

◆ isBaseOf()

bool Rose::Common::Analysis::ClassAnalysis::isBaseOf ( ClassKeyType  ancestorKey,
ClassKeyType  descendantKey 
) const

returns true, iff ancestorKey is a (direct or indirect) base class of descendantKey.

Parameters
ancestorKeypotential base class.
descendantKeypotential derived class.
Returns
true if ancestorKey is a direct or indirect base of descendantKey.

returns false when ancestorKey == descendantKey

◆ isVirtualBaseOf()

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.

Parameters
ancestorKeypotential virtual base class.
descendantKeypotential derived class.
Returns
true if ancestorKey is a direct or indirect virtual base of descendantKey.

◆ concreteDescendants()

std::vector< InheritanceDesc > Rose::Common::Analysis::ClassAnalysis::concreteDescendants ( ClassKeyType  classKey) const

returns a list of concrete descendant classes of classkey (i.e., const SgClassDefinition*)

Parameters
classKeyclass whose descendants are requested.
Returns
descriptors for concrete descendant classes known to the analysis.

◆ containsAllClasses() [1/2]

bool Rose::Common::Analysis::ClassAnalysis::containsAllClasses ( ) const
inline

property indicating whether this analysis was built for the whole AST/program or just to represent the inheritance hierarchy of a single class.

Parameters
btrue if whole program, false otherwise
Returns
true if whole program, false otherwise

Definition at line 548 of file ClassHierarchyAnalysis.h.

◆ containsAllClasses() [2/2]

void Rose::Common::Analysis::ClassAnalysis::containsAllClasses ( bool  b)
inline

property indicating whether this analysis was built for the whole AST/program or just to represent the inheritance hierarchy of a single class.

Parameters
btrue if whole program, false otherwise
Returns
true if whole program, false otherwise

Definition at line 549 of file ClassHierarchyAnalysis.h.

◆ classInfo()

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;

Parameters
classKeyclass key to describe.
Returns
diagnostic helper object for classKey.

◆ compatibilityBridge()

virtual const AbstractCompatibilityBridge & Rose::Common::Analysis::ClassAnalysis::compatibilityBridge ( ) const
pure virtual

Returns the frontend compatibility bridge associated with this analysis.

Returns
compatibility bridge used by this analysis.

Implemented in Rose::BinaryAnalysis::ByteCode::ClassHierarchy::CilHierarchyAnalysis, Rose::BinaryAnalysis::ByteCode::ClassHierarchy::JvmHierarchyAnalysis, and Rose::Source::Analysis::CppHierarchyAnalysis.


The documentation for this class was generated from the following file: