Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
ExecutorGuard Class Reference

This class can be given an executor, and will notify itself when that executor is out of work. More...

#include <Executor.hxx>

Inheritance diagram for ExecutorGuard:
Timer SyncNotifiable Notifiable Destructable

Public Member Functions

 ExecutorGuard (ExecutorBase *e)
 Constructor.
 
long long timeout () override
 Implementation of the guard functionality. Called on the executor.
 
- Public Member Functions inherited from SyncNotifiable
 SyncNotifiable ()
 Constructor.
 
void notify () override
 Implementation of notification receive.
 
void wait_for_notification ()
 Blocks the current thread until the notification is delivered.
 

Private Attributes

ExecutorBaseexecutor_
 Parent.
 
- Private Attributes inherited from QMember
QMembernext
 pointer to the next member in the queue
 

Additional Inherited Members

- Private Types inherited from Timer
enum  { NONE = 0 , RESTART = 1 , DELETE = -1 }
 Special return values from the timeout function. More...
 
- Private Member Functions inherited from Timer
 Timer (ActiveTimers *timers)
 Constructor.
 
 ~Timer ()
 Destructor.
 
void run () override
 Callback from the executor when this timer is scheduled.
 
long long schedule_time ()
 
void start (long long period=-1)
 Starts a timer.
 
void start_absolute (long long expiry_time_nsec)
 Starts the timer with an absolute deadline.
 
void restart ()
 Restart a timer with the existing period but from the current time.
 
void trigger ()
 This will wakeup the timer prematurely, immediately.
 
void ensure_triggered ()
 Triggers the timer if it is not expired yet.
 
void cancel ()
 Dangerous, do not call.
 
bool is_triggered ()
 
void set_triggered ()
 Sets the timer as if it was woken up by a trigger(), even if it was never started.
 
void update_period (long long period)
 Updates the period, to be used after the next expiration of the timer in order to restart it.
 
- Private Member Functions inherited from Executable
void test_deletion ()
 
void notify () override
 Crashes the program – everyone who is expecting notify calls must override this function.
 
virtual void alloc_result (QMember *item)
 Return the result of an alloc_async() from a memory Pool.
 
- Private Member Functions inherited from QMember
void init ()
 Initiailize a QMember, in place of a public placement construction.
 
 QMember ()
 Constructor.
 
 ~QMember ()
 Destructor.
 

Detailed Description

This class can be given an executor, and will notify itself when that executor is out of work.

Callers can pend on the sync notifiable to wait for that.

Definition at line 382 of file Executor.hxx.

Constructor & Destructor Documentation

◆ ExecutorGuard()

ExecutorGuard::ExecutorGuard ( ExecutorBase e)
inline

Constructor.

Parameters
eis the executor to look for being empty.

Definition at line 386 of file Executor.hxx.

Member Function Documentation

◆ timeout()

long long ExecutorGuard::timeout ( )
inlineoverridevirtual

Implementation of the guard functionality. Called on the executor.

Implements Timer.

Definition at line 395 of file Executor.hxx.

Member Data Documentation

◆ executor_

ExecutorBase* ExecutorGuard::executor_
private

Parent.

Definition at line 406 of file Executor.hxx.


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