neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::async_task Class Reference

#include <async_task.hpp>

Inheritance diagram for neolib::async_task:
neolib::task< reference_counted< i_async_task > > neolib::lifetime< Base > neolib::reference_counted< i_async_task > neolib::i_lifetime neolib::i_async_task neolib::i_task neolib::services::i_service neolib::i_reference_counted neogfx::async_task neogfx::async_thread neogfx::app_thread

Classes

struct  no_thread
 

Public Types

typedef i_async_task abstract_type
 
- Public Types inherited from neolib::i_async_task
typedef i_async_task abstract_type
 
- Public Types inherited from neolib::lifetime< Base >
typedef neolib::destroyed_flag destroyed_flag
 

Public Member Functions

 define_declared_event (Destroying, destroying) define_declared_event(Destroyed
 
 async_task (const std::string &aName=std::string{})
 
 async_task (i_thread &aThread, const std::string &aName=std::string{})
 
 ~async_task ()
 
i_threadthread () const override
 
bool joined () const override
 
void join (i_thread &aThread) override
 
void detach () override
 
neolib::timer_servicetimer_service () override
 
neolib::i_async_serviceio_service () override
 
bool have_message_queue () const override
 
bool have_messages () const override
 
i_message_queuecreate_message_queue (std::function< bool()> aIdleFunction=std::function< bool()>()) override
 
const i_message_queuemessage_queue () const override
 
i_message_queuemessage_queue () override
 
void register_event_queue (i_async_event_queue &aQueue) override
 
void unregister_event_queue (i_async_event_queue &aQueue) override
 
bool pump_messages () override
 
bool running () const noexcept override
 
bool halted () const noexcept override
 
void halt () override
 
bool finished () const noexcept override
 
void wait () const noexcept override
 
- Public Member Functions inherited from neolib::task< reference_counted< i_async_task > >
 task (const std::string &aName=std::string{})
 
const std::string & name () const override
 
bool do_work (yield_type aYieldType=yield_type::NoYield) override
 
void cancel () noexcept override
 
bool cancelled () const override
 
- Public Member Functions inherited from neolib::reference_counted< i_async_task >
 reference_counted () noexcept
 
 reference_counted (const reference_counted &aOther) noexcept
 
 ~reference_counted ()
 
reference_countedoperator= (const reference_counted &)
 
void add_ref () const noexcept override
 
void release () const override
 
int32_t use_count () const noexcept override
 
const base_typerelease_and_take_ownership () const override
 
base_typerelease_and_take_ownership () override
 
void pin () const noexcept override
 
void unpin () const override
 
i_ref_control_blockcontrol_block () override
 
- Public Member Functions inherited from neolib::i_task
virtual ~i_task ()=default
 
- Public Member Functions inherited from neolib::services::i_service
virtual ~i_service ()=default
 
- Public Member Functions inherited from neolib::i_reference_counted
virtual ~i_reference_counted ()=default
 
- Public Member Functions inherited from neolib::lifetime< Base >
 lifetime (lifetime_state aState=lifetime_state::Alive)
 
virtual ~lifetime ()
 
lifetime_state object_state () const final
 
std::shared_ptr< std::atomic< lifetime_state > > object_state_ptr () const final
 
bool is_creating () const final
 
bool is_alive () const final
 
bool is_destroying () const final
 
bool is_destroyed () const final
 
void set_alive () override
 
void set_destroying () override
 
void set_destroyed () override
 
- Public Member Functions inherited from neolib::i_lifetime
virtual ~i_lifetime ()=default
 

Protected Member Functions

void set_destroying () override
 
void set_destroyed () override
 
void run (yield_type aYieldType=yield_type::NoYield) override
 
bool do_work (yield_type aYieldType=yield_type::NoYield) override
 
void cancel () noexcept override
 
void idle () override
 

Friends

class async_thread
 

Additional Inherited Members

- Static Public Member Functions inherited from neolib::i_async_task
static uuid constiid ()
 

Detailed Description

Definition at line 80 of file async_task.hpp.

Member Typedef Documentation

◆ abstract_type

Constructor & Destructor Documentation

◆ async_task() [1/2]

neolib::async_task::async_task ( const std::string &  aName = std::string{})

◆ async_task() [2/2]

neolib::async_task::async_task ( i_thread aThread,
const std::string &  aName = std::string{} 
)

◆ ~async_task()

neolib::async_task::~async_task ( )

Member Function Documentation

◆ cancel()

void neolib::async_task::cancel ( )
overrideprotectedvirtualnoexcept

Implements neolib::i_task.

◆ create_message_queue()

i_message_queue & neolib::async_task::create_message_queue ( std::function< bool()>  aIdleFunction = std::function< bool()>())
overridevirtual

Implements neolib::i_async_task.

◆ define_declared_event()

neolib::async_task::define_declared_event ( Destroying  ,
destroying   
)

◆ detach()

void neolib::async_task::detach ( )
overridevirtual

Implements neolib::i_async_task.

◆ do_work()

bool neolib::async_task::do_work ( yield_type  aYieldType = yield_type::NoYield)
overrideprotectedvirtual

Implements neolib::i_task.

◆ finished()

bool neolib::async_task::finished ( ) const
overridevirtualnoexcept

Implements neolib::i_async_task.

◆ halt()

void neolib::async_task::halt ( )
overridevirtual

Implements neolib::i_async_task.

◆ halted()

bool neolib::async_task::halted ( ) const
overridevirtualnoexcept

Implements neolib::i_async_task.

◆ have_message_queue()

bool neolib::async_task::have_message_queue ( ) const
overridevirtual

Implements neolib::i_async_task.

◆ have_messages()

bool neolib::async_task::have_messages ( ) const
overridevirtual

Implements neolib::i_async_task.

◆ idle()

void neolib::async_task::idle ( )
overrideprotectedvirtual

Implements neolib::i_async_task.

◆ io_service()

neolib::i_async_service & neolib::async_task::io_service ( )
overridevirtual

Implements neolib::i_async_task.

◆ join()

void neolib::async_task::join ( i_thread aThread)
overridevirtual

Implements neolib::i_async_task.

◆ joined()

bool neolib::async_task::joined ( ) const
overridevirtual

Implements neolib::i_async_task.

◆ message_queue() [1/2]

const i_message_queue & neolib::async_task::message_queue ( ) const
overridevirtual

Implements neolib::i_async_task.

◆ message_queue() [2/2]

i_message_queue & neolib::async_task::message_queue ( )
overridevirtual

Implements neolib::i_async_task.

◆ pump_messages()

bool neolib::async_task::pump_messages ( )
overridevirtual

Implements neolib::i_async_task.

◆ register_event_queue()

void neolib::async_task::register_event_queue ( i_async_event_queue aQueue)
overridevirtual

Implements neolib::i_async_task.

◆ run()

void neolib::async_task::run ( yield_type  aYieldType = yield_type::NoYield)
overrideprotectedvirtual

Implements neolib::i_task.

◆ running()

bool neolib::async_task::running ( ) const
overridevirtualnoexcept

Implements neolib::i_async_task.

◆ set_destroyed()

void neolib::async_task::set_destroyed ( )
overrideprotectedvirtual

Implements neolib::i_lifetime.

◆ set_destroying()

void neolib::async_task::set_destroying ( )
overrideprotectedvirtual

Implements neolib::i_lifetime.

◆ thread()

i_thread & neolib::async_task::thread ( ) const
overridevirtual

Implements neolib::i_async_task.

◆ timer_service()

neolib::timer_service & neolib::async_task::timer_service ( )
overridevirtual

Implements neolib::i_async_task.

◆ unregister_event_queue()

void neolib::async_task::unregister_event_queue ( i_async_event_queue aQueue)
overridevirtual

Implements neolib::i_async_task.

◆ wait()

void neolib::async_task::wait ( ) const
overridevirtualnoexcept

Implements neolib::i_async_task.

Friends And Related Symbol Documentation

◆ async_thread

Definition at line 82 of file async_task.hpp.


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