Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ZombieCheck Class Reference

#include "lib/zombie-check.hpp"

Description

Automatic lifecycle tracker, to produce an alarm when accessing objects after deletion.

Warning
ensure the ZombieCheck instance lives in static memory, otherwise it won't work.

Definition at line 50 of file zombie-check.hpp.

Public Member Functions

 ZombieCheck (string id)
 install a zombie check, tagged with the given id.
 
 ZombieCheck ()=default
 
 ~ZombieCheck ()
 
 operator bool () const
 
void operator() () const
 

Private Member Functions

string buildDiagnosticMessage () const
 

Private Attributes

bool deceased_ = false
 
char zombieID_ [42] {}
 

Constructor & Destructor Documentation

◆ ZombieCheck() [1/2]

ZombieCheck ( string  id)
inline

install a zombie check, tagged with the given id.

When invoked after death, the raised error::Fatal includes this ID in the diagnostic message.

Remarks
recommended to use util::typeStr

Definition at line 62 of file zombie-check.hpp.

References ZombieCheck::zombieID_.

◆ ZombieCheck() [2/2]

ZombieCheck ( )
default

◆ ~ZombieCheck()

~ZombieCheck ( )
inline

Definition at line 68 of file zombie-check.hpp.

References ZombieCheck::deceased_.

Member Function Documentation

◆ operator bool()

operator bool ( ) const
inline

Definition at line 73 of file zombie-check.hpp.

References ZombieCheck::deceased_.

◆ operator()()

void operator() ( ) const
inline

Definition at line 79 of file zombie-check.hpp.

References ZombieCheck::buildDiagnosticMessage(), and ZombieCheck::deceased_.

+ Here is the call graph for this function:

◆ buildDiagnosticMessage()

string buildDiagnosticMessage ( ) const
inlineprivate

Definition at line 88 of file zombie-check.hpp.

References ZombieCheck::zombieID_.

Referenced by ZombieCheck::operator()().

+ Here is the caller graph for this function:

Member Data Documentation

◆ deceased_

bool deceased_ = false
private

◆ zombieID_

char zombieID_[42] {}
private
+ Collaboration diagram for ZombieCheck:

The documentation for this class was generated from the following file: