ROSE 2.23.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
Rose::Source::Analysis::CppHierarchyAnalysis Class Referencefinal

Description

Binds Rose::Common::Analysis::ClassAnalysis to C++ ROSE AST nodes and stores C++-specific metadata.

Definition at line 29 of file CppHierarchyAnalysis.h.

#include <Rose/Source/Analysis/CppHierarchyAnalysis.h>

Inheritance diagram for Rose::Source::Analysis::CppHierarchyAnalysis:
Inheritance graph
[legend]
Collaboration diagram for Rose::Source::Analysis::CppHierarchyAnalysis:
Collaboration graph
[legend]

Public Types

using base = Rose::Common::Analysis::ClassAnalysis
 Base class-analysis type.
 
using SpecialMemberFunctionMap = std::unordered_map< Rose::Common::Analysis::ClassKeyType, SpecialMemberFunctionContainer >
 Map from class keys to their detected special member functions.
 
using base = ClassAnalysisBase
 Base map type used for storage.
 
- Public Types inherited from Rose::Common::Analysis::ClassAnalysis
using base = ClassAnalysisBase
 Base map type used for storage.
 

Public Member Functions

const CppCompatibility & compatibilityBridge () const override
 Returns the C++ compatibility bridge.
 
Rose::Common::Analysis::ASTRootType rootId (const SgProject *root) const
 Converts a ROSE project root pointer to an abstract analysis key.
 
SgProject * root (Rose::Common::Analysis::ASTRootType key) const
 Converts an abstract analysis key back to a ROSE project root pointer.
 
Rose::Common::Analysis::ClassKeyType classId (const SgClassDefinition *cls) const
 Converts a ROSE class definition pointer to an abstract analysis key.
 
SgClassDefinition * classDefinition (Rose::Common::Analysis::ClassKeyType key) const
 Converts an abstract class key back to a ROSE class definition pointer.
 
Rose::Common::Analysis::FunctionKeyType functionId (const SgFunctionDeclaration *fun) const
 Converts a ROSE function declaration pointer to an abstract analysis key.
 
SgFunctionDeclaration * functionDeclaration (Rose::Common::Analysis::FunctionKeyType key) const
 Converts an abstract function key back to a ROSE function declaration pointer.
 
Rose::Common::Analysis::VariableKeyType variableId (SgInitializedName *var) const
 Converts a ROSE initialized-name pointer to an abstract variable key.
 
Rose::Common::Analysis::VariableKeyType variableId (SgVariableDeclaration *var) const
 Converts a ROSE variable declaration pointer to an abstract variable key.
 
SgInitializedName * variableDeclaration (Rose::Common::Analysis::VariableKeyType key) const
 Converts an abstract variable key back to a ROSE initialized-name pointer.
 
Rose::Common::Analysis::FunctionTypeKeyType functionTypeId (const SgFunctionType *ty) const
 Converts a ROSE function type pointer to an abstract function type key.
 
SgFunctionType * functionType (Rose::Common::Analysis::FunctionTypeKeyType key) const
 Converts an abstract function type key back to a ROSE function type pointer.
 
Rose::Common::Analysis::TypeKeyType typeId (const SgType *ty) const
 Converts a ROSE type pointer to an abstract type key.
 
SgType * type (Rose::Common::Analysis::TypeKeyType key) const
 Converts an abstract type key back to a ROSE type pointer.
 
std::string nameOf (const SgClassDefinition *cls) const
 Returns a printable source name for a ROSE class definition.
 
std::string nameOf (const SgFunctionDeclaration *fun) const
 Returns a printable source name for a ROSE function declaration.
 
std::string nameOf (const SgInitializedName *var) const
 Returns a printable source name for a ROSE initialized name (field).
 
SpecialMemberFunctionContainer & specialMemberFunctions (Rose::Common::Analysis::ClassKeyType clazz)
 Returns mutable special member function metadata for clazz.
 
const SpecialMemberFunctionContainer & specialMemberFunctions (Rose::Common::Analysis::ClassKeyType clazz) const
 Returns special member function metadata for clazz.
 
std::uint32_t languageStandard () const
 returns the version identifier of the language standard.
 
void languageStandard (std::uint32_t v)
 Sets the version identifier of the language standard.
 
- Public Member Functions inherited from Rose::Common::Analysis::ClassAnalysis
 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.
 
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.
 

Static Public Attributes

static constexpr std::uint32_t Cxx98 = 199711L
 C++98 language standard identifier.
 
static constexpr std::uint32_t Cxx11 = 201103L
 C++11 language standard identifier.
 
static constexpr std::uint32_t Cxx14 = 201402L
 C++14 language standard identifier.
 
static constexpr std::uint32_t Cxx17 = 201703L
 C++17 language standard identifier.
 
static constexpr std::uint32_t Cxx20 = 202002L
 C++20 language standard identifier.
 
static constexpr std::uint32_t Cxx23 = 202302L
 C++23 language standard identifier.
 
static constexpr std::uint32_t Cxx26 = 202600L
 Draft C++26 language standard identifier.
 

Member Typedef Documentation

◆ base [1/2]

Base class-analysis type.

Definition at line 34 of file CppHierarchyAnalysis.h.

◆ SpecialMemberFunctionMap

Map from class keys to their detected special member functions.

Definition at line 38 of file CppHierarchyAnalysis.h.

◆ base [2/2]

Base map type used for storage.

Definition at line 465 of file ClassHierarchyAnalysis.h.

Member Function Documentation

◆ compatibilityBridge()

const CppCompatibility & Rose::Source::Analysis::CppHierarchyAnalysis::compatibilityBridge ( ) const
overridevirtual

Returns the C++ compatibility bridge.

Returns
compatibility bridge used by this C++ analysis.

Implements Rose::Common::Analysis::ClassAnalysis.

◆ rootId()

Rose::Common::Analysis::ASTRootType Rose::Source::Analysis::CppHierarchyAnalysis::rootId ( const SgProject *  root) const

Converts a ROSE project root pointer to an abstract analysis key.

Parameters
rootROSE project pointer to wrap.
Returns
abstract key for root.

◆ root()

SgProject * Rose::Source::Analysis::CppHierarchyAnalysis::root ( Rose::Common::Analysis::ASTRootType  key) const

Converts an abstract analysis key back to a ROSE project root pointer.

Parameters
keyabstract root key to unwrap.
Returns
ROSE project pointer represented by key.

◆ classId()

Rose::Common::Analysis::ClassKeyType Rose::Source::Analysis::CppHierarchyAnalysis::classId ( const SgClassDefinition *  cls) const

Converts a ROSE class definition pointer to an abstract analysis key.

Parameters
clsROSE class definition pointer to wrap.
Returns
abstract key for cls.

◆ classDefinition()

SgClassDefinition * Rose::Source::Analysis::CppHierarchyAnalysis::classDefinition ( Rose::Common::Analysis::ClassKeyType  key) const

Converts an abstract class key back to a ROSE class definition pointer.

Parameters
keyabstract class key to unwrap.
Returns
ROSE class definition pointer represented by key.

◆ functionId()

Rose::Common::Analysis::FunctionKeyType Rose::Source::Analysis::CppHierarchyAnalysis::functionId ( const SgFunctionDeclaration *  fun) const

Converts a ROSE function declaration pointer to an abstract analysis key.

Parameters
funROSE function declaration pointer to wrap.
Returns
abstract key for fun.

◆ functionDeclaration()

SgFunctionDeclaration * Rose::Source::Analysis::CppHierarchyAnalysis::functionDeclaration ( Rose::Common::Analysis::FunctionKeyType  key) const

Converts an abstract function key back to a ROSE function declaration pointer.

Parameters
keyabstract function key to unwrap.
Returns
ROSE function declaration pointer represented by key.

◆ variableId() [1/2]

Rose::Common::Analysis::VariableKeyType Rose::Source::Analysis::CppHierarchyAnalysis::variableId ( SgInitializedName *  var) const

Converts a ROSE initialized-name pointer to an abstract variable key.

Parameters
varROSE initialized-name pointer to wrap.
Returns
abstract key for var.

◆ variableId() [2/2]

Rose::Common::Analysis::VariableKeyType Rose::Source::Analysis::CppHierarchyAnalysis::variableId ( SgVariableDeclaration *  var) const

Converts a ROSE variable declaration pointer to an abstract variable key.

Parameters
varROSE variable declaration pointer to wrap.
Returns
abstract key for var.

◆ variableDeclaration()

SgInitializedName * Rose::Source::Analysis::CppHierarchyAnalysis::variableDeclaration ( Rose::Common::Analysis::VariableKeyType  key) const

Converts an abstract variable key back to a ROSE initialized-name pointer.

Parameters
keyabstract variable key to unwrap.
Returns
ROSE initialized-name pointer represented by key.

◆ functionTypeId()

Rose::Common::Analysis::FunctionTypeKeyType Rose::Source::Analysis::CppHierarchyAnalysis::functionTypeId ( const SgFunctionType *  ty) const

Converts a ROSE function type pointer to an abstract function type key.

Parameters
tyROSE function type pointer to wrap.
Returns
abstract key for ty.

◆ functionType()

SgFunctionType * Rose::Source::Analysis::CppHierarchyAnalysis::functionType ( Rose::Common::Analysis::FunctionTypeKeyType  key) const

Converts an abstract function type key back to a ROSE function type pointer.

Parameters
keyabstract function type key to unwrap.
Returns
ROSE function type pointer represented by key.

◆ typeId()

Rose::Common::Analysis::TypeKeyType Rose::Source::Analysis::CppHierarchyAnalysis::typeId ( const SgType *  ty) const

Converts a ROSE type pointer to an abstract type key.

Parameters
tyROSE type pointer to wrap.
Returns
abstract key for ty.

◆ type()

SgType * Rose::Source::Analysis::CppHierarchyAnalysis::type ( Rose::Common::Analysis::TypeKeyType  key) const

Converts an abstract type key back to a ROSE type pointer.

Parameters
keyabstract type key to unwrap.
Returns
ROSE type pointer represented by key.

◆ nameOf() [1/3]

std::string Rose::Source::Analysis::CppHierarchyAnalysis::nameOf ( const SgClassDefinition *  cls) const

Returns a printable source name for a ROSE class definition.

Parameters
clsROSE class definition to name.
Returns
printable source name for cls.

◆ nameOf() [2/3]

std::string Rose::Source::Analysis::CppHierarchyAnalysis::nameOf ( const SgFunctionDeclaration *  fun) const

Returns a printable source name for a ROSE function declaration.

Parameters
funROSE function declaration to name.
Returns
printable source name for fun.

◆ nameOf() [3/3]

std::string Rose::Source::Analysis::CppHierarchyAnalysis::nameOf ( const SgInitializedName *  var) const

Returns a printable source name for a ROSE initialized name (field).

Parameters
varROSE initialized name to name.
Returns
printable source name for var.

◆ specialMemberFunctions() [1/2]

SpecialMemberFunctionContainer & Rose::Source::Analysis::CppHierarchyAnalysis::specialMemberFunctions ( Rose::Common::Analysis::ClassKeyType  clazz)

Returns mutable special member function metadata for clazz.

Parameters
clazzclass key whose metadata is requested.
Returns
mutable container of special member function descriptors.

◆ specialMemberFunctions() [2/2]

const SpecialMemberFunctionContainer & Rose::Source::Analysis::CppHierarchyAnalysis::specialMemberFunctions ( Rose::Common::Analysis::ClassKeyType  clazz) const

Returns special member function metadata for clazz.

Parameters
clazzclass key whose metadata is requested.
Returns
container of special member function descriptors.

◆ languageStandard() [1/2]

std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::languageStandard ( ) const
inline

returns the version identifier of the language standard.

Returns
language standard identifier associated with this analysis.

Definition at line 156 of file CppHierarchyAnalysis.h.

◆ languageStandard() [2/2]

void Rose::Source::Analysis::CppHierarchyAnalysis::languageStandard ( std::uint32_t  v)
inline

Sets the version identifier of the language standard.

Parameters
vlanguage standard identifier to record.

Definition at line 160 of file CppHierarchyAnalysis.h.

Member Data Documentation

◆ Cxx98

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx98 = 199711L
staticconstexpr

C++98 language standard identifier.

Definition at line 163 of file CppHierarchyAnalysis.h.

◆ Cxx11

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx11 = 201103L
staticconstexpr

C++11 language standard identifier.

Definition at line 166 of file CppHierarchyAnalysis.h.

◆ Cxx14

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx14 = 201402L
staticconstexpr

C++14 language standard identifier.

Definition at line 169 of file CppHierarchyAnalysis.h.

◆ Cxx17

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx17 = 201703L
staticconstexpr

C++17 language standard identifier.

Definition at line 172 of file CppHierarchyAnalysis.h.

◆ Cxx20

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx20 = 202002L
staticconstexpr

C++20 language standard identifier.

Definition at line 175 of file CppHierarchyAnalysis.h.

◆ Cxx23

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx23 = 202302L
staticconstexpr

C++23 language standard identifier.

Definition at line 178 of file CppHierarchyAnalysis.h.

◆ Cxx26

constexpr std::uint32_t Rose::Source::Analysis::CppHierarchyAnalysis::Cxx26 = 202600L
staticconstexpr

Draft C++26 language standard identifier.

Definition at line 181 of file CppHierarchyAnalysis.h.


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