AWS SDK for C++  1.9.157
AWS SDK for C++
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Aws::Utils::Threading::DefaultExecutor Class Reference

#include <Executor.h>

+ Inheritance diagram for Aws::Utils::Threading::DefaultExecutor:

Public Member Functions

 DefaultExecutor ()
 
 ~DefaultExecutor ()
 
- Public Member Functions inherited from Aws::Utils::Threading::Executor
virtual ~Executor ()=default
 
template<class Fn , class ... Args>
bool Submit (Fn &&fn, Args &&... args)
 

Protected Types

enum  State { State::Free, State::Locked, State::Shutdown }
 

Protected Member Functions

bool SubmitToThread (std::function< void()> &&) override
 
void Detach (std::thread::id id)
 

Protected Attributes

std::atomic< Statem_state
 
Aws::UnorderedMap< std::thread::id, std::thread > m_threads
 

Detailed Description

Default Executor implementation. Simply spawns a thread and detaches it.

Definition at line 56 of file Executor.h.

Member Enumeration Documentation

◆ State

Enumerator
Free 
Locked 
Shutdown 

Definition at line 62 of file Executor.h.

Constructor & Destructor Documentation

◆ DefaultExecutor()

Aws::Utils::Threading::DefaultExecutor::DefaultExecutor ( )
inline

Definition at line 59 of file Executor.h.

◆ ~DefaultExecutor()

Aws::Utils::Threading::DefaultExecutor::~DefaultExecutor ( )

Member Function Documentation

◆ Detach()

void Aws::Utils::Threading::DefaultExecutor::Detach ( std::thread::id  id)
protected

◆ SubmitToThread()

bool Aws::Utils::Threading::DefaultExecutor::SubmitToThread ( std::function< void()> &&  )
overrideprotectedvirtual

To implement your own executor implementation, then simply subclass Executor and implement this method.

Implements Aws::Utils::Threading::Executor.

Member Data Documentation

◆ m_state

std::atomic<State> Aws::Utils::Threading::DefaultExecutor::m_state
protected

Definition at line 68 of file Executor.h.

◆ m_threads

Aws::UnorderedMap<std::thread::id, std::thread> Aws::Utils::Threading::DefaultExecutor::m_threads
protected

Definition at line 69 of file Executor.h.


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