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) |
| auto | GetNodes(const Formula * connector)<br>Retrieves nodes from a connector. |
| auto | GetNodes(Expression * connector) |
| auto | GetConnectors(const Formula * connector)<br>Retrieves connectors from a connector. |
| auto | GetConnectors(Expression * connector) |
| bool | ContinueConnector(Branch * connector, std::vector< NamedBranch * > * cycle)<br>Cycle detection specialization for event tree named branches. |
| bool | ContinueConnector(const Instruction * connector, std::vector< Rule * > * cycle)<br>Cycle detection specialization for visitor-based traversal of instructions. |
| bool | ContinueConnector(const EventTree * connector, std::vector< Link * > * cycle)<br>Cycle detection specialization for visitor-based traversal of event-trees. |
| template <class T ,class N > <br>bool | ContinueConnector(T * connector, std::vector< N * > * cycle)<br>Helper function to check for cyclic references through connectors. |
| template <class T > <br>bool | DetectCycle(T * node, std::vector< T * > * cycle)<br>Traverses nodes with connectors to find a cycle. |
| bool | ContinueConnector(Branch * connector, std::vector< NamedBranch * > * cycle)<br>Cycle detection specialization for event tree named branches. |
| bool | ContinueConnector(const Instruction * connector, std::vector< Rule * > * cycle)<br>Cycle detection specialization for visitor-based traversal of instructions. |
| bool | ContinueConnector(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::string | PrintCycle(const std::vector< T * > & cycle)<br>Prints the detected cycle from the output produced by cycle detection functions. |
| template <class T ,class SinglePassRange > <br>void | CheckCycle(const SinglePassRange & container, const char * type)<br>Checks for cycles in a model constructs. |
Functions Documentation
function GetConnector
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
inline Expression * GetConnector(
Parameter * node
)function GetConnector
inline Branch * GetConnector(
NamedBranch * node
)function GetConnector
inline const Instruction * GetConnector(
Rule * node
)function GetConnector
inline const EventTree * GetConnector(
Link * node
)function GetNodes
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
inline auto GetNodes(
Expression * connector
)function GetConnectors
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
inline auto GetConnectors(
Expression * connector
)function ContinueConnector
bool ContinueConnector(
Branch * connector,
std::vector< NamedBranch * > * cycle
)Cycle detection specialization for event tree named branches.
function ContinueConnector
bool ContinueConnector(
const Instruction * connector,
std::vector< Rule * > * cycle
)Cycle detection specialization for visitor-based traversal of instructions.
function ContinueConnector
bool ContinueConnector(
const EventTree * connector,
std::vector< Link * > * cycle
)Cycle detection specialization for visitor-based traversal of event-trees.
function ContinueConnector
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
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
bool ContinueConnector(
Branch * connector,
std::vector< NamedBranch * > * cycle
)Cycle detection specialization for event tree named branches.
function ContinueConnector
bool ContinueConnector(
const Instruction * connector,
std::vector< Rule * > * cycle
)Cycle detection specialization for visitor-based traversal of instructions.
function ContinueConnector
bool ContinueConnector(
const EventTree * connector,
std::vector< Link * > * cycle
)Cycle detection specialization for visitor-based traversal of event-trees.
function GetUniqueName
template <class T >
const std::string & GetUniqueName(
const T * node
)Retrieves a unique name for a node.
function GetUniqueName
inline const std::string & GetUniqueName(
const Link * node
)Specialization for event-tree link name retrieval.
function PrintCycle
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
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
