Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::ThreadRelay::RelayBase Class Referenceabstract

Base class for the ThreadRelay::Relay0,1,2,3 templates for storing in a list. More...

#include <ThreadRelay.h>

Inheritance diagram for sf::ThreadRelay::RelayBase:
Collaboration diagram for sf::ThreadRelay::RelayBase:

Public Member Functions

 RelayBase (ThreadRelay &tr)
 Constructor.
 
virtual ~RelayBase ()=default
 Default virtual destructor.
 
virtual void call ()=0
 Pure virtual function to override in the derived template class to call a method.
 
 operator bool ()
 Blocks the thread when the thread id is different then the thread which created the ThreadRelay instance.
 

Protected Attributes

std::atomic< bool > _sentry {false}
 Prevents the execution of the method more the once.
 
ThreadRelay_tr
 Prevents the execution of the method more the once.
 
Semaphore _semaphore
 Holds the semaphore to stop the thread until the method is executed.
 
friend ThreadRelay
 

Detailed Description

Base class for the ThreadRelay::Relay0,1,2,3 templates for storing in a list.

Constructor & Destructor Documentation

◆ RelayBase()

sf::ThreadRelay::RelayBase::RelayBase ( ThreadRelay tr)
inlineexplicit

Constructor.

◆ ~RelayBase()

virtual sf::ThreadRelay::RelayBase::~RelayBase ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ call()

virtual void sf::ThreadRelay::RelayBase::call ( )
pure virtual

Pure virtual function to override in the derived template class to call a method.

◆ operator bool()

sf::ThreadRelay::RelayBase::operator bool ( )
explicit

Blocks the thread when the thread id is different then the thread which created the ThreadRelay instance.

Returns
True when acquired.

Member Data Documentation

◆ _semaphore

Semaphore sf::ThreadRelay::RelayBase::_semaphore
protected

Holds the semaphore to stop the thread until the method is executed.

◆ _sentry

std::atomic<bool> sf::ThreadRelay::RelayBase::_sentry {false}
protected

Prevents the execution of the method more the once.

◆ _tr

ThreadRelay& sf::ThreadRelay::RelayBase::_tr
protected

Prevents the execution of the method more the once.

◆ ThreadRelay

friend sf::ThreadRelay::RelayBase::ThreadRelay
protected

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