CIRCT 22.0.0git
Loading...
Searching...
No Matches
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.
 
void addTask (std::function< void(void)> task)
 

Private Member Functions

void loop ()
 

Private Attributes

volatile bool shutdown = false
 
std::thread me
 
std::mutex m
 
std::map< ReadChannelPort *, std::pair< std::function< void(ReadChannelPort *, MessageData)>, std::future< MessageData > > > listeners
 
std::vector< std::function< void(void)> > taskList
 Tasks which should be called on every loop iteration.
 

Detailed Description

Definition at line 344 of file Accelerator.cpp.

Constructor & Destructor Documentation

◆ Impl()

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

Definition at line 345 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 429 of file Accelerator.cpp.

◆ addTask()

void esi::AcceleratorServiceThread::Impl::addTask ( std::function< void(void)>  task)
inline

Definition at line 357 of file Accelerator.cpp.

References m, and taskList.

◆ loop()

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

Definition at line 380 of file Accelerator.cpp.

References assert(), listeners, m, shutdown, and taskList.

◆ start()

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

Definition at line 346 of file Accelerator.cpp.

References me.

◆ stop()

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

Definition at line 347 of file Accelerator.cpp.

References me, and shutdown.

Member Data Documentation

◆ listeners

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

Definition at line 374 of file Accelerator.cpp.

Referenced by loop().

◆ m

std::mutex esi::AcceleratorServiceThread::Impl::m
private

Definition at line 368 of file Accelerator.cpp.

Referenced by addTask(), and loop().

◆ me

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

Definition at line 365 of file Accelerator.cpp.

Referenced by start(), and stop().

◆ shutdown

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

Definition at line 364 of file Accelerator.cpp.

Referenced by loop(), and stop().

◆ taskList

std::vector<std::function<void(void)> > esi::AcceleratorServiceThread::Impl::taskList
private

Tasks which should be called on every loop iteration.

Definition at line 377 of file Accelerator.cpp.

Referenced by addTask(), and loop().


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