Bienvenue sur la nouvelle documentation de CppUtils !
CppUtils::UnitTest::LifetimeChecker
CLASSDiagnostic utility for tracking and validating object lifecycles in unit tests.
Description
Section intitulée « Description »Monitors default construction, copy, move, and destruction events via a callback logger, while maintaining thread-safe atomic counters for copy and move operations.
Méthodes publiques
Section intitulée « Méthodes publiques »LifetimeChecker::LifetimeChecker(std::function<void(std::string_view)> callback, std::string name, std::size_t indentationLevel = 0);Constructs a LifetimeChecker and logs object creation.
| Paramètre | Description |
|---|---|
callback | Logging callback receiving string views of lifecycle events. |
name | Diagnostic identifier of the monitored object. |
indentationLevel | Tab indentation level for hierarchical visual logging. |
Returns the total number of copy constructions and copy assignments performed.
Retourne : Cumulative copy operation count.
Returns the total number of move constructions and move assignments performed.
Retourne : Cumulative move operation count.
Destroys the LifetimeChecker and logs the destruction event.