![]() |
nomlib
|
Interface for running and controlling action flow. More...
#include <ActionPlayer.hpp>
Public Types | |
| enum | State { RUNNING = 0 , PAUSED , STOPPED } |
| The status of the player. More... | |
| typedef ActionPlayer | self_type |
| typedef std::vector< const char * > | action_names |
Public Member Functions | |
| ActionPlayer (const ActionPlayer &rhs)=delete | |
| Disabled copy constructor. | |
| ActionPlayer & | operator= (const ActionPlayer &rhs)=delete |
| Disabled copy assignment operator. | |
| bool | idle () const |
| Get the status of the action queue. | |
| nom::size_type | num_actions () const |
| Get the number of actions enqueued. | |
| ActionPlayer::State | player_state () const |
| Get the control status of the queue. | |
| void | pause () |
| Freeze the enqueued actions from advancing forward in time. | |
| void | resume () |
| Resume the advancement of time for the enqueued actions. | |
| void | stop () |
| Reset the enqueued actions back to its initial starting state. | |
| bool | action_running (const std::string &action_id) const |
| Get the completion status of an action. | |
| bool | cancel_action (const std::string &action_id) |
| Stop executing an action. | |
| void | cancel_actions (const action_names &actions) |
| void | cancel_actions () |
| Stop executing the enqueued actions. | |
| bool | run_action (const std::shared_ptr< IActionObject > &action) |
| Enqueue an action. | |
| bool | run_action (const std::shared_ptr< IActionObject > &action, const action_callback_func &completion_func) |
| Enqueue an action with a completion callback. | |
| bool | update (real32 delta_time) |
| Run the enqueued actions' update loop. | |
Private Types | |
| typedef std::map< std::string, std::unique_ptr< DispatchQueue > > | container_type |
| typedef container_type::iterator | container_iterator |
Private Member Functions | |
| bool | run_action (const std::shared_ptr< IActionObject > &action, std::unique_ptr< DispatchQueue > dispatch_queue, const action_callback_func &completion_func) |
| Enqueue an action that runs on a specific dispatch queue. | |
Private Attributes | |
| ActionPlayer::State | player_state_ |
| container_type | actions_ |
| Enqueued actions. | |
| std::deque< container_iterator > | free_list_ |
| The actions pending removal. | |
Static Private Attributes | |
| static const char * | DEBUG_CLASS_NAME |
Interface for running and controlling action flow.
This is the high-level interface for scheduling and controlling the flow of actions. You may find that using multiple instances of the interface is ideal if you have several action groups that can be managed independently from each other.
TODO: This documentation section is a STUB!
Definition at line 49 of file ActionPlayer.hpp.
| typedef std::vector<const char*> nom::ActionPlayer::action_names |
Definition at line 55 of file ActionPlayer.hpp.
|
private |
Definition at line 206 of file ActionPlayer.hpp.
|
private |
Definition at line 204 of file ActionPlayer.hpp.
| typedef ActionPlayer nom::ActionPlayer::self_type |
Definition at line 52 of file ActionPlayer.hpp.
The status of the player.
Definition at line 58 of file ActionPlayer.hpp.
| bool nom::ActionPlayer::action_running | ( | const std::string & | action_id | ) | const |
Get the completion status of an action.
| action_id | The unique identifier of the action. |
| bool nom::ActionPlayer::cancel_action | ( | const std::string & | action_id | ) |
Stop executing an action.
| action_id | The unique identifier of the action to stop. |
| void nom::ActionPlayer::cancel_actions | ( | ) |
Stop executing the enqueued actions.
| bool nom::ActionPlayer::idle | ( | ) | const |
Get the status of the action queue.
| void nom::ActionPlayer::pause | ( | ) |
Freeze the enqueued actions from advancing forward in time.
| ActionPlayer::State nom::ActionPlayer::player_state | ( | ) | const |
Get the control status of the queue.
| void nom::ActionPlayer::resume | ( | ) |
Resume the advancement of time for the enqueued actions.
| bool nom::ActionPlayer::run_action | ( | const std::shared_ptr< IActionObject > & | action | ) |
Enqueue an action.
| action | The action to run; NULL actions are valid. |
| bool nom::ActionPlayer::run_action | ( | const std::shared_ptr< IActionObject > & | action, |
| const action_callback_func & | completion_func ) |
Enqueue an action with a completion callback.
| action | The action to run; NULL actions are valid. |
| completion_func | The function to call when the action is completed – passing NULL here is valid. |
|
private |
Enqueue an action that runs on a specific dispatch queue.
| action | The action to run; NULL actions are valid. |
| completion_func | The function to call when the action is completed – passing NULL here is valid. |
| dispatch_queue | A valid nom::DispatchQueue to run the action on. |
| void nom::ActionPlayer::stop | ( | ) |
Reset the enqueued actions back to its initial starting state.
| bool nom::ActionPlayer::update | ( | real32 | delta_time | ) |
Run the enqueued actions' update loop.
| delta_time | Reserved for application-defined implementations. |
|
private |
Enqueued actions.
Definition at line 211 of file ActionPlayer.hpp.
|
staticprivate |
Definition at line 201 of file ActionPlayer.hpp.
|
private |
The actions pending removal.
Definition at line 214 of file ActionPlayer.hpp.
|
private |
Definition at line 208 of file ActionPlayer.hpp.