LogicEngineReport

class rlogic::LogicEngineReport

A collection of results from rlogic::LogicEngine::update which can be used for debugging or profiling logic node networks. Can be obtained using rlogic::LogicEngine::getLastUpdateReport after an update with enabled reporting (rlogic::LogicEngine::enableUpdateReport).

Public Types

using LogicNodeTimed = std::pair<LogicNode*, std::chrono::microseconds>

LogicNode with measured update execution.

Public Functions

const std::vector<LogicNodeTimed> &getNodesExecuted() const

Gets list of logic nodes that were updated and the amount of time it took to execute their update logic. Typically nodes have to be updated due to one of their inputs being ‘dirty’ (modified) or some other internal trigger. The order of the nodes in the list matches the order of their execution, this order is determined by the logic network topology and is deterministic.

Return

list of updated nodes with update execution time, sorted by execution order

const std::vector<LogicNode*> &getNodesSkippedExecution() const

List of logic nodes that were not updated because their inputs did not change therefore there was no need to. Similar to getNodesExecuted, the order of the nodes in the list matches the order of their (in this case skipped) execution.

Return

list of nodes which did not need update

std::chrono::microseconds getTopologySortExecutionTime() const

Time it took to sort logic nodes by their topology during update. Note that re-sorting is only needed if topology changed (node linked/unlinked), otherwise the result is cached and this should take negligible time.

Return

time to sort logic nodes

std::chrono::microseconds getTotalUpdateExecutionTime() const

Time it took to update the whole logic nodes network. This is essentially the same as measuring how long it took to call rlogic::LogicEngine::update from application side.

Return

time to update all logic nodes

size_t getTotalLinkActivations() const

Obtain the number of links activated during update.

Return

the number of links activated during update

LogicEngineReport() noexcept

Default constructor of LogicEngineReport.

LogicEngineReport(std::unique_ptr<internal::LogicEngineReportImpl> impl) noexcept

Constructor of LogicEngineReport. Do not construct, use rlogic::LogicEngine::getLastUpdateReport to obtain.

Parameters

~LogicEngineReport()

Class destructor

LogicEngineReport(const LogicEngineReport&) = delete

Copying disabled, move instead.

LogicEngineReport(LogicEngineReport &&other) noexcept

Move constructor

Parameters
  • other: source

LogicEngineReport &operator=(const LogicEngineReport&) = delete

Copying disabled, move instead.

LogicEngineReport &operator=(LogicEngineReport &&other) noexcept

Move assignment

Parameters
  • other: source