The internal processing queue for actions.
More...
#include <DispatchQueue.hpp>
|
|
nom::size_type | num_actions () const |
| | Get the total number of enqueued actions.
|
| bool | enqueue_action (const std::shared_ptr< IActionObject > &action, const action_callback_func &completion_func) |
| | Append an action to the list of actions to be executed.
|
| DispatchQueue::State | update (uint32 player_state, real32 delta_time) |
| | Run the enqueued actions' update loop.
|
|
(Note that these are not member symbols.)
|
| template<typename ObjectType, typename... ObjectArgs> |
| std::unique_ptr< ObjectType > | create_dispatch_queue (ObjectArgs &&... args) |
| | Constructor function for creating a nom::DispatchQueue.
|
The internal processing queue for actions.
This interface was inspired by Apple's Grand Central Dispatch (GCD).
- See also
- nom::ActionPlayer
Definition at line 48 of file DispatchQueue.hpp.
◆ container_type
| typedef std::vector<std::unique_ptr<DispatchEnqueue> > nom::DispatchQueue::container_type |
|
private |
◆ iterator_type
| typedef container_type::iterator nom::DispatchQueue::iterator_type |
|
private |
◆ self_type
| typedef DispatchQueue nom::DispatchQueue::self_type |
◆ State
◆ enqueue_action()
| bool nom::DispatchQueue::enqueue_action |
( |
const std::shared_ptr< IActionObject > & | action, |
|
|
const action_callback_func & | completion_func ) |
Append an action to the list of actions to be executed.
- Parameters
-
| action | The action to run; NULL actions are valid. |
| completion_func | An optional function to call when the action is completed – passing NULL here will ignore this parameter. |
◆ update()
Run the enqueued actions' update loop.
- Parameters
-
| player_state | One of the ActionPlayer::State enumeration values. |
| delta_time | Reserved for application-defined implementations. |
- Returns
- DispatchQueue::State::RUNNING if one or more actions are executing, or DispatchQueue::State::IDLING when no actions are running, such as when the queue is empty.
- Todo
- Pausing the action does not always take effect for every nom::MoveByAction in the group within ActionTest.RainingRectsStressTest – some actions are sometimes skipped for some mysterious reason!
- See also
- nom::ActionPlayer::update.
◆ create_dispatch_queue()
template<typename ObjectType, typename... ObjectArgs>
| std::unique_ptr< ObjectType > create_dispatch_queue |
( |
ObjectArgs &&... | args | ) |
|
|
related |
◆ actions_
| container_type nom::DispatchQueue::actions_ |
|
private |
◆ actions_iterator_
| iterator_type nom::DispatchQueue::actions_iterator_ |
|
private |
◆ DEBUG_CLASS_NAME
| const char* nom::DispatchQueue::DEBUG_CLASS_NAME |
|
staticprivate |
◆ num_actions_
| nom::size_type nom::DispatchQueue::num_actions_ = 0 |
|
private |
The documentation for this class was generated from the following file: