6.5.1.2. Edges (Dependencies)¶
Edge Types¶
Source_Dependency¶
The
Source_Dependency is an abstract edge type,
all other edges that somehow describe what is going on in 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.
// 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 setting, using, or address-taking
of an
Object or
Memberby a
Routine. The edge is directed from the routine to the
object/member. Similarly, address-taking of
Routines is
represented by
References between the routines.
Since Reference is an abstract edge type, edges of this type will not
appear within a view created directly from code like Code Facts.
Instead, one of its concrete subtypes (e.g. Member_Set,
Variable_Use or Routine_Address) will be 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 that a type occurs in the
signature (i.e., either as parameter type or as return type) of a
Routine. The edge is directed from the routine to the type.
Since Signature is an abstract edge type, edges having this type will not
appear within a view created directly from code like Code Facts. Instead,
one of its concrete subtypes Parameter_Of_Type or Return_Type)
will be 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 semantic 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 of information that is available, not the information the language will use for overloading etc.
Of_Type¶
Of_Type models that an
Object
is of a type. The edge is directed from the
Object 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 relation of 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
relation 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 to 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 semantic 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, their 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 at once, except for cases like 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 not guaranteed anymore. The same is true if one adds nodes by means of scripts or by incorporating GXL files. The RFG itself does not prevent or even warn about 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 definition of the entity. If no definition has been seen, one of the declarations is chosen arbitrarily. If there is more than one place of definition in the source, one is chosen arbitrarily.For a node in the
Declaration Factsview, the four attributes characterize the source location of the definition or declaration (an entity may have multiple nodes that represent its definition and its possibly various declarations).Note
Nodes of the two views
Code FactsandDeclaration Factscan also be part of other views.Note
As long as any entity has a unique point of definition (e.g., only in one header or C source file), the source location information will be the same, no matter which order of translation and linking of the system is 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 in parts of the system under analysis that are not yet analyzed. If you create partial RFG files, the parts that are not inside the partial RFG are also not marked withLinkage.Is_Definition.
There are additional attributes for language-specific information.