#include <graph.h>
A port connection consists of up to seven independent wires:
In most cases you only need a combination of a value and dependency wire.
The Wires class has the members value, dependency, context, hidden, inhibit, slink, tlink to store information about these wires for a connection. Each of them has the enumeration type WIRE_MODE with the following possible values:
The wires of a connection can also be accessed by index, see VALUE, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK, TLINK and operator[]. For a loop over the wires you have to use COUNT as upper bound:
A Wires object can also be used as a mask to test another Wires object. Wires masks use the mask values of WIRE_MODE (WIRE_MODE::NONE, WIRE_MODE::ALL, WIRE_MODE::IMPLICIT, WIRE_MODE::ALL_INCLUDING_IMPLICIT, WIRE_MODE::INHERIT, WIRE_MODE::FULL_MASK). Testing against a mask is done by the bitwise operators & and |.
Static Public Member Functions | |
static constexpr Wires | All (WIRE_MODE mode=WIRE_MODE::ALL) |
static constexpr Bool | TriviallyHashable () |
Public Attributes | |
WIRE_MODE | value |
WIRE_MODE | unused |
WIRE_MODE | dependency |
WIRE_MODE | context |
WIRE_MODE | hidden |
WIRE_MODE | inhibit |
WIRE_MODE | slink |
WIRE_MODE | tlink |
Static Public Attributes | |
static const Int | VALUE |
static const Int | UNUSED |
static const Int | DEPENDENCY |
static const Int | CONTEXT |
static const Int | HIDDEN |
static const Int | INHIBIT |
static const Int | SLINK |
static const Int | TLINK |
static const Int | COUNT |
static const WIRE_MODE | NONE |
Private Member Functions | |
UInt64 | ToInt () const |
Wires (UInt64 i, Bool) | |
constexpr | Wires (WIRE_MODE val, WIRE_MODE un, WIRE_MODE dep, WIRE_MODE ctx, WIRE_MODE hid, WIRE_MODE inh, WIRE_MODE sln, WIRE_MODE tln) |
|
constexprdefault |
Constructs an empty Wires object. All wire modes are set to WIRE_MODE::NONE.
|
constexpr |
Constructs a normal wire for values and dependencies. The value and dependency members will be set to the given mode, all other members to WIRE_MODE::NONE.
[in] | mode | The mode to use for the value and dependency wires. |
|
explicit |
Constructs a single wire. The wire indexed by the given index will be set to the given mode, all other members to WIRE_MODE::NONE.
[in] | index | The index of the wire, one of VALUE, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK. |
[in] | mode | The mode to use for the wire. |
Constructs the wires using the given modes.
[in] | val | The mode for the value wire. |
[in] | dep | The mode for the dependency wire. |
|
constexpr |
Constructs the wires using the given modes.
[in] | val | The mode for the value wire. |
[in] | dep | The mode for the dependency wire. |
[in] | ctx | The mode for the context wire. |
[in] | hid | The mode for the hidden wire. |
[in] | inh | The mode for the inherit wire. |
[in] | sln | The mode for the slink wire. |
[in] | tln | The mode for the tlink wire. |
|
delete |
Only for internal use, dummy Bool parameter to disambiguate constructor calls.
|
constexprprivate |
Constructs the wires using the given modes.
[in] | val | The mode for the value wire. |
[in] | un | The mode for the unused wire. |
[in] | dep | The mode for the dependency wire. |
[in] | ctx | The mode for the context wire. |
[in] | hid | The mode for the hidden wire. |
[in] | inh | The mode for the inherit wire. |
[in] | sln | The mode for the slink wire. |
[in] | tln | The mode for the tlink wire. |
Returns the mode for the wire indexed by index.
[in] | index | The index of the wire, one of VALUE, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK, TLINK. |
Returns the mode for the wire indexed by index.
[in] | index | The index of the wire, one of VALUE, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK, TLINK. |
|
staticconstexpr |
Returns a Wires value where all wire modes are set to the given mode. With the default WIRE_MODE::ALL this can be used as a mask which represents all wires, this is useful as argument to PortTemplate::GetConnections to get all connections.
[in] | mode | The mode to use for all wires, WIRE_MODE::ALL by default. |
|
explicit |
Checks if there is any wire.
Adds the wires of other to this Wires object. This is implemented by a bitwise or of the underlying integral values, and it makes sense only if both Wires objects only use mask values of WIRE_MODE, or if they don't have overlapping wires. For a parallel combination of two general Wires see Combine().
[in] | other | Another Wires object. |
Returns the bitwise or of the underlying integral values. This makes sense only if both Wires objects only use mask values of WIRE_MODE, or if they don't have overlapping wires. For a parallel combination of two general Wires see Combine().
[in] | other | Another Wires object. |
Wires operator~ | ( | ) | const |
Returns the bitwise inverse of the underlying integral values. This makes sense only if this Wires object is a mask where the wire modes are mask values of WIRE_MODE. Then the returned object is the inverse of this mask.
HashInt GetHashCode | ( | ) | const |
Returns the hash code of this @CLASS.
|
staticconstexpr |
UniqueHash GetUniqueHashCode | ( | ) | const |
Wires ToMask | ( | ) | const |
Converts this Wires object into a mask which uses WIRE_MODE::FULL_MASK for wires which are set in this Wires object, otherwise WIRE_MODE::NONE.
Returns the wire-wise comparison of this and other. This uses WIRE_MODE::FULL_MASK for a wire with the same value in this and other, or WIRE_MODE::NONE if the values differ.
[in] | other | Another Wires object. |
String ToString | ( | const FormatStatement * | fs = nullptr | ) | const |
|
private |
Only for internal use.
WIRE_MODE value |
The mode for the value part of the connection.
WIRE_MODE unused |
Unused.
WIRE_MODE dependency |
The mode for the dependency part of the connection.
WIRE_MODE context |
The mode for the context part of the connection.
WIRE_MODE hidden |
The mode for the hidden part of the connection.
WIRE_MODE inhibit |
The mode for the inhibit part of the connection.
WIRE_MODE slink |
The mode for the slink part of the connection.
WIRE_MODE tlink |
The mode for the tlink part of the connection.
|
static |
The index to address the value part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the unused part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the dependency part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the context part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the hidden part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the inhibit part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the slink part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The index to address the tlink part, used in operator[] and Wires(Int,WIRE_MODE).
|
static |
The number of wires (currently 8). Use this for a loop over all possible wire indices.
|
static |
Constant indicating no wires at all.