Advanced Multi-Physics (AMP)
On-Line Documentation
Protected Member Functions | Private Slots | Private Attributes | List of all members
ThreadedSlotsClass Class Reference

This is a helper class that allows a thread to call a function from the main thread. More...

#include <ThreadedSlotsClass.h>

Inheritance diagram for ThreadedSlotsClass:
Inheritance graph
[legend]

Protected Member Functions

void callFun (std::function< void(void)> &&fun)
 Call a function.
 
 ThreadedSlotsClass ()
 Empty constructor.
 
void update ()
 Process queue events.
 
virtual ~ThreadedSlotsClass ()
 Destructor.
 

Private Slots

void callFunMain ()
 

Private Attributes

QAction * d_callAction
 
std::function< void(void)> d_fun
 
std::thread::id d_id
 
std::mutex d_mutex
 
volatile bool d_running
 

Detailed Description

This is a helper class that allows a thread to call a function from the main thread.

Definition at line 13 of file ThreadedSlotsClass.h.

Constructor & Destructor Documentation

◆ ThreadedSlotsClass()

ThreadedSlotsClass::ThreadedSlotsClass ( )
protected

Empty constructor.

◆ ~ThreadedSlotsClass()

virtual ThreadedSlotsClass::~ThreadedSlotsClass ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ callFun()

void ThreadedSlotsClass::callFun ( std::function< void(void)> &&  fun)
protected

Call a function.

◆ callFunMain

void ThreadedSlotsClass::callFunMain ( )
privateslot

◆ update()

void ThreadedSlotsClass::update ( )
protected

Process queue events.

Member Data Documentation

◆ d_callAction

QAction* ThreadedSlotsClass::d_callAction
private

Definition at line 29 of file ThreadedSlotsClass.h.

◆ d_fun

std::function<void( void )> ThreadedSlotsClass::d_fun
private

Definition at line 28 of file ThreadedSlotsClass.h.

◆ d_id

std::thread::id ThreadedSlotsClass::d_id
private

Definition at line 32 of file ThreadedSlotsClass.h.

◆ d_mutex

std::mutex ThreadedSlotsClass::d_mutex
private

Definition at line 31 of file ThreadedSlotsClass.h.

◆ d_running

volatile bool ThreadedSlotsClass::d_running
private

Definition at line 30 of file ThreadedSlotsClass.h.


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page