6.5.1.2. Edges (Dependencies)¶
Edge Types¶
Source_Dependency¶
The
Source_Dependency is an abstract edge type;
all other edges that describe the source code inherit from
this edge type.
Note
You can use this edge to express “some kind of relationship” in an architecture model.
Call¶
A
Call represents a call between
Routines. The edge is directed from the calling routine to the called
routine. Since Call is an abstract edge type, edges of this type do not
appear within a view created directly from code, such as Code Facts. Instead,
one of its concrete subtypes (e.g., Static_Call or
Dispatching_Call) is used. However, Call can be used within
architecture model views to express a more restricted dependency than, e.g.,
Source_Dependency.
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
void g (void);
void h (void);
void f (void)
{
g();
h();
}
Calls from routine f to routines g and h.¶
Reference¶
A
Reference represents the setting, using, or taking of the
address of an
Object or
Memberby a
Routine. The edge is directed from the routine to the
object/member. Similarly, taking the address of
Routines is
represented by
References between the routines.
Since Reference is an abstract edge type, edges of this type do not
appear within a view created directly from code, such as Code Facts.
Instead, one of its concrete subtypes (e.g., Member_Set,
Variable_Use, or Routine_Address) is used (see also the
example below). However,
Reference can be used within architecture model views to express a more restricted
dependency than, e.g., Source_Dependency.
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
int G;
int H;
void f (void)
{
G = H;
}
References from a routine f to objects H (reading its value) and
G (setting its value).¶
Signature¶
A
Signature represents a type that occurs in the
signature (i.e., either as a parameter type or as a return type) of a
Routine. The edge is directed from the routine to the type.
Since Signature is an abstract edge type, edges of this type do not
appear within a view created directly from code, such as Code Facts. Instead,
one of its concrete subtypes (Parameter_Of_Type or Return_Type)
is used (see also the example below). However,
Signature can be used within architecture model views to express a more restricted
dependency than, e.g., Source_Dependency.
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
typedef int T;
T f (void) {}
void g(T param) {}
Type T occurs in the signature of routine f (as return type) and in
the signature of g (as parameter type).¶
Note
The meaning of “signature” used here does not necessarily follow the semantics of the programming language under analysis. In some languages, the return type belongs to the signature, in others it does not. We always show the maximum amount of information that is available, not the information the language will use for overloading etc.
Of_Type¶
Of_Type models that an
Object
or
Member is of a specific type. The edge is directed from the
object or member to the type.
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
typedef int T;
struct S { T member; };
A member is of type T (and the member is part of type S).¶
Extend¶
An
Extend represents a direct inheritance relationship between two
classes. The edge is directed from the child class to the parent class.
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
class P {};
class C : public P {};
A class C extends its parent class P.¶
Instance_Of¶
An
Instance_Of edge indicates a template instantiation
relationship between a
Template node and an instantiated
entity (e.g., a generic class and a class in C#).
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
template <class T> void TF (void) {}
void caller(void)
{
TF<int>();
}
A template function TF and an instantiation of that template called by
routine caller.¶
Instantiate¶
An
Instantiate E → T edge indicates
that an entity E (like a member of a class) references an instance of a type
T.
Enclosing¶
An
Enclosing edge indicates that an entity is enclosed
within another entity (e.g., a member is declared inside a type).
The hierarchy expressed by
Enclosing edges and other
kinds of
Belongs_To edges must form a forest.
// Copyright (C) 2025 Axivion GmbH
// Copyright (C) 2025 The Qt Company GmbH, a subsidiary of The Qt Group
// https://www.qt.io
class T {
public:
int field;
void method (void);
};
A type T and its enclosed entities field and method.¶
Attributes¶
Attributes for nodes and edges are named according to a hierarchical schema. The parts of
an attribute name are separated by dots, e. g., “Source.Name”. The
following top-level classification for attribute prefixes is used:
Name Prefix |
Meaning |
|---|---|
|
Information on the source: Position, name etc. |
|
Information for the linkage process: Link name, definition state etc. |
|
Information on the language-based semantics of the element: visibility state, staticness, kind of type etc. |
|
Metric information: Lines of Code, Halstead, McCabe etc. |
other prefixes |
Attributes added by analyses (later on in the analysis process) or the visualization front ends. |
- Source.Name
The
Source.Name(of typestring) is the name the entity possesses in the source code. If an entity does not have a name – for instance, anonymousstructsin C – its name will be a question mark?.- Linkage.Name
The
Linkage.Name(of typestring) unambiguously identifies the entity within one RFG.Note
The language front ends guarantee this property for the translation units they process simultaneously, except in cases of violations of the one-definition rule. It is also possible to combine (link) RFGs representing source units that do not link in reality, in which case the property of uniqueness is no longer guaranteed. The same is true when adding nodes via scripts or by incorporating GXL files. The RFG itself does not prevent or warn against non-unique link names.
- Source.File, Source.Path, Source.Line, Source.Column
Source.FileandSource.Pathare of typestring;Source.LineandSource.Columnare of typeint.For a node in the
Code Factsview, these four attributes characterize the source location of the entity’s definition. If no definition has been encountered, one of the declarations is chosen arbitrarily. If there are multiple definition sites in the source, one is chosen arbitrarily.For a node in the
Declaration Factsview, these four attributes characterize the source location of the definition or declaration (an entity may have multiple nodes representing its definition and its various declarations).Note
Nodes of the two views
Code FactsandDeclaration Factscan also be part of other views.Note
As long as an entity has a unique definition point (e.g., only in one header or C source file), the source location information will remain the same, regardless of the order in which the system’s translation and linking are performed.
- Linkage.Is_Definition
The attribute of type
toggleindicates whether the node represents a definition. Nodes that do not possess this attribute are from the environment (e.g.,printf) or are in parts of the system under analysis that have not yet been analyzed. If partial RFG files are created, the parts outside the partial RFG are also not marked withLinkage.Is_Definition.
There are additional attributes for language-specific information.