ROSE 2.23.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Rose::Common::Analysis::OverrideDesc Struct Reference

Description

Describes an override relationship for one virtual function.

An override descriptor is stored on both sides of the relationship: in VirtualFunctionDesc::overriders() of the overridden function and in VirtualFunctionDesc::overridden() of the overriding function.

A declared override (the overriding function is declared in a class that derives from the class declaring the overridden function) has an invalid witness key. An implied override has a valid witness: the class at which a function inherited along the non-virtual inheritance chain first meets a function of a virtual base that it implements (e.g., in Java a superclass method implementing an interface method of a subclass, JLS 8.4.8.1). The overriding function's class is then not derived from the overridden function's class; only the witness is. Implied overrides are only computed when AbstractCompatibilityBridge::inheritedMethodsImplementVirtualBaseMethods returns true.

Definition at line 123 of file ClassHierarchyAnalysis.h.

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

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

Public Types

using base = std::tuple< FunctionKeyType, bool, ClassKeyType >
 Base tuple type used for storage.
 

Public Member Functions

 OverrideDesc (FunctionKeyType fn, bool covariant)
 Constructs a descriptor for a declared override (no witness).
 
FunctionKeyType function () const
 Returns the overriding or overridden function key.
 
bool covariantReturn () const
 Returns true when the override uses a covariant return type.
 
bool adjustReturnObj () const
 returns true of an object adjustment is needed upon return.
 
ClassKeyType witness () const
 Returns the witness class of an implied override.
 
bool isImplied () const
 Returns true when this is an implied override (see class description).
 

Member Typedef Documentation

◆ base

Base tuple type used for storage.

Definition at line 127 of file ClassHierarchyAnalysis.h.

Constructor & Destructor Documentation

◆ OverrideDesc()

Rose::Common::Analysis::OverrideDesc::OverrideDesc ( FunctionKeyType  fn,
bool  covariant 
)
inline

Constructs a descriptor for a declared override (no witness).

Parameters
fnoverriding or overridden function key.
covarianttrue if the override uses a covariant return type.

Definition at line 133 of file ClassHierarchyAnalysis.h.

Member Function Documentation

◆ function()

FunctionKeyType Rose::Common::Analysis::OverrideDesc::function ( ) const
inline

Returns the overriding or overridden function key.

Returns
function key stored by this override descriptor.

Definition at line 139 of file ClassHierarchyAnalysis.h.

◆ covariantReturn()

bool Rose::Common::Analysis::OverrideDesc::covariantReturn ( ) const
inline

Returns true when the override uses a covariant return type.

Returns
true if this relationship uses a covariant return.

Definition at line 143 of file ClassHierarchyAnalysis.h.

◆ adjustReturnObj()

bool Rose::Common::Analysis::OverrideDesc::adjustReturnObj ( ) const
inline

returns true of an object adjustment is needed upon return.

this should be a subset of covariantReturn() [only if the original and the new return types have different primary base classes], but currently we use the same value.

Returns
true if a return-object adjustment is required.

Definition at line 150 of file ClassHierarchyAnalysis.h.

◆ witness()

ClassKeyType Rose::Common::Analysis::OverrideDesc::witness ( ) const
inline

Returns the witness class of an implied override.

Returns
class key of the class at which the inherited function and the virtual base function meet; an invalid key for declared overrides.

Definition at line 155 of file ClassHierarchyAnalysis.h.

Referenced by isImplied().

◆ isImplied()

bool Rose::Common::Analysis::OverrideDesc::isImplied ( ) const
inline

Returns true when this is an implied override (see class description).

Returns
true if witness() is a valid class key.

Definition at line 159 of file ClassHierarchyAnalysis.h.

References witness().


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