StuBS
Guarded Class Reference

A handy interface to protect critical sections. More...

#include <interrupt/guarded.h>

Public Member Functions

 Guarded ()
 Constructor: Enter guarded section.
 
 ~Guarded ()
 Destructor: Leave guarded section.
 

Private Member Functions

 Guarded (const Guarded &)=delete
 
Guardedoperator= (const Guarded &)=delete
 

Detailed Description

A handy interface to protect critical sections.

This exploits the way how the C++ compiler automatically creates constructor and destructor calls in the code, especially when the scope in which an object was declared is left.

So if you enter a critical section using its constructor and leave it again in the destructor, you can easily mark critical code areas as follows:

// non-critical section
...
{
Guarded section;
// critical section
...
}
// non-critical section
A handy interface to protect critical sections.
Definition guarded.h:32

Constructor & Destructor Documentation

◆ Guarded() [1/2]

Guarded::Guarded ( const Guarded )
privatedelete

◆ Guarded() [2/2]

Guarded::Guarded ( )
inline

Constructor: Enter guarded section.

Todo:
Implement Constructor

◆ ~Guarded()

Guarded::~Guarded ( )
inline

Destructor: Leave guarded section.

Todo:
Implement destructor

Member Function Documentation

◆ operator=()

Guarded & Guarded::operator= ( const Guarded )
privatedelete

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