29#ifndef NOMLIB_ACTIONS_DISPATCH_QUEUE_HPP
30#define NOMLIB_ACTIONS_DISPATCH_QUEUE_HPP
36#include "nomlib/config.hpp"
37#include "nomlib/core/unique_ptr.hpp"
43struct DispatchEnqueue;
45typedef std::function<void()> action_callback_func;
51 typedef DispatchQueue self_type;
73 const action_callback_func& completion_func );
92 update(uint32 player_state, real32 delta_time);
95 static const char* DEBUG_CLASS_NAME;
97 typedef std::vector<std::unique_ptr<DispatchEnqueue>> container_type;
98 typedef container_type::iterator iterator_type;
102 iterator_type actions_iterator_;
113template<
typename ObjectType,
typename... ObjectArgs>
116 auto dispatch_queue =
117 nom::make_unique<ObjectType>( std::forward<ObjectArgs>(args) ... );
119 return std::move(dispatch_queue);
The internal processing queue for actions.
nom::size_type num_actions() const
Get the total number of enqueued actions.
nom::size_type num_actions_
The total number of actions enqueued.
State
The status of the queue.
container_type actions_
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.
std::unique_ptr< ObjectType > create_dispatch_queue(ObjectArgs &&... args)
Constructor function for creating a nom::DispatchQueue.
DispatchQueue::State update(uint32 player_state, real32 delta_time)
Run the enqueued actions' update loop.
Pure virtual base class interface for actions.