Class DebugManager#

Class Documentation#

class DebugManager#

A structure to hold variables that are useful for debugging.

Public Static Functions

static bool getUsageTrackingErrors()#

Get the value of usage tracking errors.

Usage tracking errors is used to enable/disable error messages when discarding variables. If true, it will print errors if the variable if still in use. If false, it will only print a warning, but will continue on anyway.

Returns:

Whether usage tracking errors is enabled or disabled.

static void setUsageTrackingErrors(bool enable)#

Set the value of usage tracking errors.

Usage tracking errors is used to enable/disable error messages when discarding variables. If true, it will print errors if the variable if still in use. If false, it will only print a warning, but will continue on anyway.

Parameters:

enable – If true, then enable usage tracking errors. If false, then disable it.

static std::vector<ks_ptr<const Base>> inUseBy(const ks_ptr<Base> &base)#

Return the list of Base objects that are using the provided one.

The list includes objects that are referring to this object, but not ones that will remove the reference if this object were discarded. The purpose of this method is to catch commonly occurring dependencies that will get in the way of discarding this object.

Parameters:

base – The object to get the list of objects that depend upon it.

Returns:

List of objects that depend on this one.

static void dumpInUseBy(const ks_ptr<Base> &base)#

Display the list of Base objects that are using this one.

Parameters:

baseBase object to dump users of.

static void dumpDependencyTree(const ks_ptr<LockingBase> &locking_base, std::string_view prefix = "", int depth = -1, bool downstream = true)#

Display the dependency tree for the provided LockingBase.

Parameters:
  • locking_base – The LockingBase to display the dependency tree for.

  • prefix – Optional prefix to add to each line.

  • depth – Depth to traverse (default -1 means no limit).

  • downstream – Whether to show downstream (true) or upstream (false) dependencies.

static void dumpDependencyGraphviz(const ks_ptr<LockingBase> &locking_base, const std::filesystem::path &filename, const std::vector<ks_ptr<LockingBase>> &terminal = {}, int downstream_depth = -1, int upstream_depth = -1)#

Create a Graphviz dot file representing the dependency graph.

Parameters:
  • locking_base – The LockingBase to display the dependency graph for.

  • filename – Output filename.

  • terminal – Nodes to be considered as terminal nodes (stop created graph on current branch if one of these is reached).

  • downstream_depth – Max depth for downstream traversal.

  • upstream_depth – Max depth for upstream traversal.

Public Static Attributes

static std::optional<size_t> all_destroyed_message_limit#

Limit for the number of messages printed by all destroyed. Nullopt will print them all.

static bool enable_locking_trace#

Boolean used to enable/disable tracing of LockingBase. Enabling this will print messages whenever a LockingBase is made healthy or not healthy. It will also print messages when new dependents are added. This affects all LockingBases.

Friends

friend class UsageTrackingMap