Skip to content

scram::mef::cycle

Functions

Name
const Formula *GetConnector(Gate * node)<br>Determines the connectors between nodes.
Expression *GetConnector(Parameter * node)
Branch *GetConnector(NamedBranch * node)
const Instruction *GetConnector(Rule * node)
const EventTree *GetConnector(Link * node)
autoGetNodes(const Formula * connector)<br>Retrieves nodes from a connector.
autoGetNodes(Expression * connector)
autoGetConnectors(const Formula * connector)<br>Retrieves connectors from a connector.
autoGetConnectors(Expression * connector)
boolContinueConnector(Branch * connector, std::vector< NamedBranch * > * cycle)<br>Cycle detection specialization for event tree named branches.
boolContinueConnector(const Instruction * connector, std::vector< Rule * > * cycle)<br>Cycle detection specialization for visitor-based traversal of instructions.
boolContinueConnector(const EventTree * connector, std::vector< Link * > * cycle)<br>Cycle detection specialization for visitor-based traversal of event-trees.
template <class T ,class N > <br>boolContinueConnector(T * connector, std::vector< N * > * cycle)<br>Helper function to check for cyclic references through connectors.
template <class T > <br>boolDetectCycle(T * node, std::vector< T * > * cycle)<br>Traverses nodes with connectors to find a cycle.
boolContinueConnector(Branch * connector, std::vector< NamedBranch * > * cycle)<br>Cycle detection specialization for event tree named branches.
boolContinueConnector(const Instruction * connector, std::vector< Rule * > * cycle)<br>Cycle detection specialization for visitor-based traversal of instructions.
boolContinueConnector(const EventTree * connector, std::vector< Link * > * cycle)<br>Cycle detection specialization for visitor-based traversal of event-trees.
template <class T > <br>const std::string &GetUniqueName(const T * node)<br>Retrieves a unique name for a node.
const std::string &GetUniqueName(const Link * node)<br>Specialization for event-tree link name retrieval.
template <class T > <br>std::stringPrintCycle(const std::vector< T * > & cycle)<br>Prints the detected cycle from the output produced by cycle detection functions.
template <class T ,class SinglePassRange > <br>voidCheckCycle(const SinglePassRange & container, const char * type)<br>Checks for cycles in a model constructs.

Functions Documentation

function GetConnector

cpp
inline const Formula * GetConnector(
    Gate * node
)

Determines the connectors between nodes.

Parameters:

  • node The node under cycle investigation.

Return: The connector belonging to the node.

function GetConnector

cpp
inline Expression * GetConnector(
    Parameter * node
)

function GetConnector

cpp
inline Branch * GetConnector(
    NamedBranch * node
)

function GetConnector

cpp
inline const Instruction * GetConnector(
    Rule * node
)

function GetConnector

cpp
inline const EventTree * GetConnector(
    Link * node
)

function GetNodes

cpp
inline auto GetNodes(
    const Formula * connector
)

Retrieves nodes from a connector.

Parameters:

  • connector The connector starting from another node.

Return: The iterable collection of nodes on the other end of connection.

function GetNodes

cpp
inline auto GetNodes(
    Expression * connector
)

function GetConnectors

cpp
inline auto GetConnectors(
    const Formula * connector
)

Retrieves connectors from a connector.

Parameters:

  • connector The connector starting from another node.

Return: The iterable collection of connectors.

function GetConnectors

cpp
inline auto GetConnectors(
    Expression * connector
)

function ContinueConnector

cpp
bool ContinueConnector(
    Branch * connector,
    std::vector< NamedBranch * > * cycle
)

Cycle detection specialization for event tree named branches.

function ContinueConnector

cpp
bool ContinueConnector(
    const Instruction * connector,
    std::vector< Rule * > * cycle
)

Cycle detection specialization for visitor-based traversal of instructions.

function ContinueConnector

cpp
bool ContinueConnector(
    const EventTree * connector,
    std::vector< Link * > * cycle
)

Cycle detection specialization for visitor-based traversal of event-trees.

function ContinueConnector

cpp
template <class T ,
class N >
bool ContinueConnector(
    T * connector,
    std::vector< N * > * cycle
)

Helper function to check for cyclic references through connectors.

Parameters:

  • connector Connector to nodes.
  • cycle The cycle path if detected.

Template Parameters:

  • T The type managing the connectors (nodes, edges).
  • N The node type.

Return: True if a cycle is detected.

Connectors may get market upon traversal.

Connectors and nodes of the connector are retrieved via unqualified calls: GetConnectors(connector) and GetNodes(connector).

function DetectCycle

cpp
template <class T >
bool DetectCycle(
    T * node,
    std::vector< T * > * cycle
)

Traverses nodes with connectors to find a cycle.

Parameters:

  • node The node to start with.
  • cycle If a cycle is detected, it is given in reverse, ending with the cycle node.

Template Parameters:

  • T The type of nodes in the graph.

Return: True if a cycle is found.

Postcondition: All traversed nodes are marked with non-clear marks.

Interrupts the detection at first cycle. Nodes get marked.

The connector of the node is retrieved via unqualified call to GetConnector(node).

function ContinueConnector

cpp
bool ContinueConnector(
    Branch * connector,
    std::vector< NamedBranch * > * cycle
)

Cycle detection specialization for event tree named branches.

function ContinueConnector

cpp
bool ContinueConnector(
    const Instruction * connector,
    std::vector< Rule * > * cycle
)

Cycle detection specialization for visitor-based traversal of instructions.

function ContinueConnector

cpp
bool ContinueConnector(
    const EventTree * connector,
    std::vector< Link * > * cycle
)

Cycle detection specialization for visitor-based traversal of event-trees.

function GetUniqueName

cpp
template <class T >
const std::string & GetUniqueName(
    const T * node
)

Retrieves a unique name for a node.

function GetUniqueName

cpp
inline const std::string & GetUniqueName(
    const Link * node
)

Specialization for event-tree link name retrieval.

function PrintCycle

cpp
template <class T >
std::string PrintCycle(
    const std::vector< T * > & cycle
)

Prints the detected cycle from the output produced by cycle detection functions.

Parameters:

  • cycle Cycle containing nodes in reverse order.

Template Parameters:

  • T The node type with GetUniqueName(T*) defined.

Return: String representation of the cycle.

function CheckCycle

cpp
template <class T ,
class SinglePassRange >
void CheckCycle(
    const SinglePassRange & container,
    const char * type
)

Checks for cycles in a model constructs.

Parameters:

  • container The range with nodes to be tested.
  • type The type of nodes for error messages.

Exceptions:

  • CycleError A cycle is detected in the graph of nodes.

Template Parameters:

  • T The type of the node.
  • SinglePassRange The range type with nodes.

Updated on 2025-11-11 at 16:51:08 +0000