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 construction, copy, move, and destruction events via a callback logger, while tracking copy, move, and shared active instance counts.
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.
Returns the current number of active instances sharing this tracked object.
Retourne : Active instance count (0 if moved-from).
Destroys the LifetimeChecker and logs the destruction event.