CIRCT  19.0.0git
Public Member Functions | Private Member Functions | Private Attributes | List of all members
esi::AcceleratorServiceThread::Impl Struct Reference
Collaboration diagram for esi::AcceleratorServiceThread::Impl:
Collaboration graph
[legend]

Public Member Functions

 Impl ()
 
void start ()
 
void stop ()
 
void addListener (std::initializer_list< ReadChannelPort * > listenPorts, std::function< void(ReadChannelPort *, MessageData)> callback)
 When there's data on any of the listenPorts, call the callback. More...
 

Private Member Functions

void loop ()
 

Private Attributes

volatile bool shutdown = false
 
std::thread me
 
std::mutex listenerMutex
 
std::map< ReadChannelPort *, std::pair< std::function< void(ReadChannelPort *, MessageData)>, std::future< MessageData > > > listeners
 

Detailed Description

Definition at line 183 of file Accelerator.cpp.

Constructor & Destructor Documentation

◆ Impl()

esi::AcceleratorServiceThread::Impl::Impl ( )
inline

Definition at line 184 of file Accelerator.cpp.

Member Function Documentation

◆ addListener()

void esi::AcceleratorServiceThread::Impl::addListener ( std::initializer_list< ReadChannelPort * >  listenPorts,
std::function< void(ReadChannelPort *, MessageData)>  callback 
)

When there's data on any of the listenPorts, call the callback.

This method can be called from any thread.

Definition at line 248 of file Accelerator.cpp.

◆ loop()

void esi::AcceleratorServiceThread::Impl::loop ( )
private

Definition at line 210 of file Accelerator.cpp.

References assert(), listenerMutex, listeners, and shutdown.

Referenced by start().

◆ start()

void esi::AcceleratorServiceThread::Impl::start ( )
inline

Definition at line 185 of file Accelerator.cpp.

References loop(), and me.

◆ stop()

void esi::AcceleratorServiceThread::Impl::stop ( )
inline

Definition at line 186 of file Accelerator.cpp.

References me, and shutdown.

Member Data Documentation

◆ listenerMutex

std::mutex esi::AcceleratorServiceThread::Impl::listenerMutex
private

Definition at line 202 of file Accelerator.cpp.

Referenced by loop().

◆ listeners

std::map<ReadChannelPort *, std::pair<std::function<void(ReadChannelPort *, MessageData)>, std::future<MessageData> > > esi::AcceleratorServiceThread::Impl::listeners
private

Definition at line 207 of file Accelerator.cpp.

Referenced by loop().

◆ me

std::thread esi::AcceleratorServiceThread::Impl::me
private

Definition at line 199 of file Accelerator.cpp.

Referenced by start(), and stop().

◆ shutdown

volatile bool esi::AcceleratorServiceThread::Impl::shutdown = false
private

Definition at line 198 of file Accelerator.cpp.

Referenced by loop(), and stop().


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