AIStatefulTask ‐ Asynchronous, Stateful Task Scheduler library.

Threads-like task objects evolving through user-defined states.

AIFriendOfStatefulTask.h
Go to the documentation of this file.
1
34#pragma once
35
36#include "AIStatefulTask.h"
37
61{
62 public:
65
66 protected:
68
71
73 void set_state(state_type new_state) { m_task->set_state(new_state); }
75 void wait(condition_type conditions) { m_task->wait(conditions); }
77 void wait_until(AIWaitConditionFunc const& wait_condition, condition_type conditions) { m_task->wait_until(wait_condition, conditions); }
79 void wait_until(AIWaitConditionFunc const& wait_condition, condition_type conditions, state_type new_state) { m_task->set_state(new_state); m_task->wait_until(wait_condition, conditions); }
81 void finish() { m_task->finish(); }
83 void yield() { m_task->yield(); }
85 void target(AIEngine* engine) { m_task->target(engine); }
87 void yield(AIEngine* engine) { m_task->yield(engine); }
89 void yield_frame(AIEngine* engine, unsigned int frames) { m_task->yield_frame(engine, frames); }
91 void yield_ms(AIEngine* engine, unsigned int ms) { m_task->yield_ms(engine, ms); }
93 bool yield_if_not(AIEngine* engine) { return m_task->yield_if_not(engine); }
94};
Declaration of base class AIStatefulTask.
std::function< bool()> AIWaitConditionFunc
The type of the functor that must be passed as first parameter to AIStatefulTask::wait_until.
Definition: AIStatefulTask.h:68
Definition: AIEngine.h:110
Definition: AIFriendOfStatefulTask.h:61
void yield_frame(AIEngine *engine, unsigned int frames)
Proxy for AIStatefulTask::yield_frame.
Definition: AIFriendOfStatefulTask.h:89
AIStatefulTask::condition_type condition_type
Proxy for AIStatefulTask::condition_type.
Definition: AIFriendOfStatefulTask.h:64
AIStatefulTask * m_task
The base class of the object that this object is a member of.
Definition: AIFriendOfStatefulTask.h:67
void yield_ms(AIEngine *engine, unsigned int ms)
Proxy for AIStatefulTask::yield_ms.
Definition: AIFriendOfStatefulTask.h:91
void target(AIEngine *engine)
Proxy for AIStatefulTask::target.
Definition: AIFriendOfStatefulTask.h:85
void wait_until(AIWaitConditionFunc const &wait_condition, condition_type conditions, state_type new_state)
Proxy for AIStatefulTask::wait_until.
Definition: AIFriendOfStatefulTask.h:79
void finish()
Proxy for AIStatefulTask::finish.
Definition: AIFriendOfStatefulTask.h:81
AIStatefulTask::state_type state_type
Proxy for AIStatefulTask::state_type.
Definition: AIFriendOfStatefulTask.h:63
void set_state(state_type new_state)
Proxy for AIStatefulTask::set_state.
Definition: AIFriendOfStatefulTask.h:73
AIFriendOfStatefulTask(AIStatefulTask *task)
Construct a friend of task.
Definition: AIFriendOfStatefulTask.h:70
void yield(AIEngine *engine)
Proxy for AIStatefulTask::yield.
Definition: AIFriendOfStatefulTask.h:87
bool yield_if_not(AIEngine *engine)
Proxy for AIStatefulTask::yield_if_not.
Definition: AIFriendOfStatefulTask.h:93
void yield()
Proxy for AIStatefulTask::yield.
Definition: AIFriendOfStatefulTask.h:83
void wait_until(AIWaitConditionFunc const &wait_condition, condition_type conditions)
Proxy for AIStatefulTask::wait_until.
Definition: AIFriendOfStatefulTask.h:77
void wait(condition_type conditions)
Proxy for AIStatefulTask::wait.
Definition: AIFriendOfStatefulTask.h:75
Definition: AIStatefulTask.h:96
uint32_t state_type
The type of run_state.
Definition: AIStatefulTask.h:98
uint32_t condition_type
The type of the skip_wait and idle bit masks.
Definition: AIStatefulTask.h:99
void set_state(state_type new_state)
Definition: AIStatefulTask.cxx:1354
void finish()
Definition: AIStatefulTask.cxx:1725
void wait_until(AIWaitConditionFunc const &wait_condition, condition_type conditions)
Definition: AIStatefulTask.cxx:1627
void wait(condition_type conditions)
Definition: AIStatefulTask.cxx:1507
void yield()
Definition: AIStatefulTask.cxx:1748
void yield_frame(AIEngine *engine, unsigned int frames)
Definition: AIStatefulTask.cxx:1800
void target(Handler handler)
Definition: AIStatefulTask.cxx:1764
bool yield_if_not(Handler handler)
Definition: AIStatefulTask.cxx:1790
void yield_ms(AIEngine *engine, unsigned int ms)
Definition: AIStatefulTask.cxx:1809