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

A notifiable class that calls a particular function object once when it is invoked, then deletes itself. More...

#include <Executable.hxx>

Inheritance diagram for CallbackExecutable:
Executable Notifiable QMember Destructable

Public Member Functions

 CallbackExecutable (std::function< void()> &&body)
 Constructor.
 
void run () override
 Calls the notification method.
 
- Public 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.
 
- Public Member Functions inherited from QMember
void init ()
 Initiailize a QMember, in place of a public placement construction.
 

Private Attributes

std::function< void()> body_
 Function object (callback) to call.
 

Additional Inherited Members

- Protected Member Functions inherited from QMember
 QMember ()
 Constructor.
 
 ~QMember ()
 Destructor.
 
- Protected Attributes inherited from QMember
QMembernext
 pointer to the next member in the queue
 

Detailed Description

A notifiable class that calls a particular function object once when it is invoked, then deletes itself.

Definition at line 71 of file Executable.hxx.

Constructor & Destructor Documentation

◆ CallbackExecutable()

CallbackExecutable::CallbackExecutable ( std::function< void()> &&  body)
inline

Constructor.

Parameters
bodyis the function object that will be called when *this is executed, just before *this is deleted.

Definition at line 76 of file Executable.hxx.

Member Function Documentation

◆ run()

void CallbackExecutable::run ( )
inlineoverridevirtual

Calls the notification method.

Implements Executable.

Definition at line 82 of file Executable.hxx.

Member Data Documentation

◆ body_

std::function<void()> CallbackExecutable::body_
private

Function object (callback) to call.

Definition at line 90 of file Executable.hxx.


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