Unravel Engine C++ Reference
Loading...
Searching...
No Matches
seq::seq_manager Struct Reference

Manages and coordinates multiple sequence actions with scoping, pausing, and updating capabilities. More...

#include <seq_manager.h>

Classes

struct  seq_info
 Stores information about an action, including its state, depth, and associated scopes. More...
 

Public Types

using action_collection_t = std::map<seq_id_t, seq_info>
 Alias for the collection of actions managed by the seq_manager.
 

Public Member Functions

seq_id_t start (seq_action action, const seq_scope_policy &scope_policy={})
 Starts a new action and associates it with the specified scope policy.
 
void stop (seq_id_t id)
 Stops the action associated with the specified ID.
 
void stop_all (const std::string &scope={})
 Stops all actions within the specified scope.
 
void pause (seq_id_t id)
 Pauses the action associated with the specified ID.
 
void pause_all (const std::string &scope={}, const std::string &key={})
 Pauses all actions within the specified scope and key.
 
void resume (seq_id_t id)
 Resumes the action associated with the specified ID.
 
void resume_all (const std::string &scope={}, const std::string &key={})
 Resumes all actions within the specified scope and key.
 
void stop_when_finished (seq_id_t id)
 Marks an action to stop when it finishes.
 
void stop_when_finished_all (const std::string &scope={})
 Marks all actions in the specified scope to stop when they finish.
 
void stop_and_finish (seq_id_t id, duration_t finish_after=0ms)
 Stops an action and ensures it completes after the specified duration.
 
void stop_and_finish_all (const std::string &scope={})
 Stops all actions in the specified scope and ensures they complete.
 
auto is_stopping (seq_id_t id) const -> bool
 Checks if an action is stopping.
 
auto is_running (seq_id_t id) const -> bool
 Checks if an action is running.
 
auto is_paused (seq_id_t id) const -> bool
 Checks if an action is paused.
 
auto is_finished (seq_id_t id) const -> bool
 Checks if an action has finished.
 
bool has_action_with_scope (const std::string &scope_id)
 Checks if there is any action associated with the specified scope ID.
 
void set_speed_multiplier (seq_id_t id, float speed_multiplier=1.0f)
 Sets the speed multiplier for an action.
 
auto get_speed_multiplier (seq_id_t id) -> float
 Gets the speed multiplier of an action.
 
auto get_elapsed (seq_id_t id) const -> duration_t
 Gets the elapsed time of an action.
 
auto get_duration (seq_id_t id) const -> duration_t
 Gets the total duration of an action.
 
auto get_overflow (seq_id_t id) const -> duration_t
 Gets the overflow time of an action.
 
void update (seq_id_t id, duration_t delta)
 Updates the elapsed time of a specific action.
 
void set_elapsed (seq_id_t id, duration_t elapsed)
 Sets the elapsed time of an action (use with caution).
 
void update (duration_t delta)
 Updates all managed actions with a time delta.
 
void push_scope (const std::string &scope)
 Pushes a scope onto the scope stack.
 
void close_scope (const std::string &scope)
 Closes a scope, removing it from the stack.
 
void pop_scope ()
 Pops the current scope from the scope stack.
 
void clear_scopes ()
 Clears all scopes from the scope stack.
 
auto get_current_scope () const -> const std::string &
 Gets the current scope from the scope stack.
 
auto get_scopes () const -> const std::vector< std::string > &
 Gets the list of all active scopes.
 
auto get_actions () const -> const action_collection_t &
 Gets the collection of all managed actions.
 

Detailed Description

Manages and coordinates multiple sequence actions with scoping, pausing, and updating capabilities.

Definition at line 17 of file seq_manager.h.

Member Typedef Documentation

◆ action_collection_t

Alias for the collection of actions managed by the seq_manager.

Definition at line 44 of file seq_manager.h.

Member Function Documentation

◆ clear_scopes()

void seq::seq_manager::clear_scopes ( )

Clears all scopes from the scope stack.

Definition at line 390 of file seq_manager.cpp.

◆ close_scope()

void seq::seq_manager::close_scope ( const std::string & scope)

Closes a scope, removing it from the stack.

Parameters
scopeThe name of the scope to close.

Definition at line 382 of file seq_manager.cpp.

◆ get_actions()

auto seq::seq_manager::get_actions ( ) const -> const action_collection_t&

Gets the collection of all managed actions.

Returns
A reference to the collection of managed actions.

Definition at line 442 of file seq_manager.cpp.

◆ get_current_scope()

auto seq::seq_manager::get_current_scope ( ) const -> const std::string&

Gets the current scope from the scope stack.

Returns
The name of the current scope.

Definition at line 427 of file seq_manager.cpp.

◆ get_duration()

auto seq::seq_manager::get_duration ( seq_id_t id) const -> duration_t

Gets the total duration of an action.

Parameters
idThe ID of the action.
Returns
The total duration.

Definition at line 272 of file seq_manager.cpp.

◆ get_elapsed()

auto seq::seq_manager::get_elapsed ( seq_id_t id) const -> duration_t

Gets the elapsed time of an action.

Parameters
idThe ID of the action.
Returns
The elapsed duration.

Definition at line 262 of file seq_manager.cpp.

◆ get_overflow()

auto seq::seq_manager::get_overflow ( seq_id_t id) const -> duration_t

Gets the overflow time of an action.

Parameters
idThe ID of the action.
Returns
The overflow duration.

Definition at line 282 of file seq_manager.cpp.

◆ get_scopes()

auto seq::seq_manager::get_scopes ( ) const -> const std::vector<std::string>&

Gets the list of all active scopes.

Returns
A reference to the list of active scopes.

Definition at line 437 of file seq_manager.cpp.

◆ get_speed_multiplier()

float seq::seq_manager::get_speed_multiplier ( seq_id_t id) -> float

Gets the speed multiplier of an action.

Parameters
idThe ID of the action.
Returns
The current speed multiplier.

Definition at line 252 of file seq_manager.cpp.

◆ has_action_with_scope()

auto seq::seq_manager::has_action_with_scope ( const std::string & scope_id)

Checks if there is any action associated with the specified scope ID.

Parameters
scope_idThe scope ID to check.
Returns
True if an action exists within the scope, false otherwise.

Definition at line 458 of file seq_manager.cpp.

◆ is_finished()

auto seq::seq_manager::is_finished ( seq_id_t id) const -> bool

Checks if an action has finished.

Parameters
idThe ID of the action to check.
Returns
True if the action has finished, false otherwise.

Definition at line 233 of file seq_manager.cpp.

◆ is_paused()

auto seq::seq_manager::is_paused ( seq_id_t id) const -> bool

Checks if an action is paused.

Parameters
idThe ID of the action to check.
Returns
True if the action is paused, false otherwise.

Definition at line 223 of file seq_manager.cpp.

◆ is_running()

auto seq::seq_manager::is_running ( seq_id_t id) const -> bool

Checks if an action is running.

Parameters
idThe ID of the action to check.
Returns
True if the action is running, false otherwise.

Definition at line 213 of file seq_manager.cpp.

◆ is_stopping()

auto seq::seq_manager::is_stopping ( seq_id_t id) const -> bool

Checks if an action is stopping.

Parameters
idThe ID of the action to check.
Returns
True if the action is stopping, false otherwise.

Definition at line 203 of file seq_manager.cpp.

◆ pause()

void seq::seq_manager::pause ( seq_id_t id)

Pauses the action associated with the specified ID.

Parameters
idThe ID of the action to pause.

Definition at line 89 of file seq_manager.cpp.

◆ pause_all()

void seq::seq_manager::pause_all ( const std::string & scope = {},
const std::string & key = {} )

Pauses all actions within the specified scope and key.

Parameters
scopeThe name of the scope (default is all scopes).
keyThe key associated with the actions (default is all keys).

Definition at line 98 of file seq_manager.cpp.

◆ pop_scope()

void seq::seq_manager::pop_scope ( )

Pops the current scope from the scope stack.

Definition at line 374 of file seq_manager.cpp.

◆ push_scope()

void seq::seq_manager::push_scope ( const std::string & scope)

Pushes a scope onto the scope stack.

Parameters
scopeThe name of the scope to push.

Definition at line 357 of file seq_manager.cpp.

◆ resume()

void seq::seq_manager::resume ( seq_id_t id)

Resumes the action associated with the specified ID.

Parameters
idThe ID of the action to resume.

Definition at line 111 of file seq_manager.cpp.

◆ resume_all()

void seq::seq_manager::resume_all ( const std::string & scope = {},
const std::string & key = {} )

Resumes all actions within the specified scope and key.

Parameters
scopeThe name of the scope (default is all scopes).
keyThe key associated with the actions (default is all keys).

Definition at line 120 of file seq_manager.cpp.

◆ set_elapsed()

void seq::seq_manager::set_elapsed ( seq_id_t id,
duration_t elapsed )

Sets the elapsed time of an action (use with caution).

Parameters
idThe ID of the action.
elapsedThe elapsed time to set.

Definition at line 301 of file seq_manager.cpp.

◆ set_speed_multiplier()

void seq::seq_manager::set_speed_multiplier ( seq_id_t id,
float speed_multiplier = 1.0f )

Sets the speed multiplier for an action.

Parameters
idThe ID of the action.
speed_multiplierThe speed multiplier to set (default is 1.0f).

Definition at line 243 of file seq_manager.cpp.

◆ start()

auto seq::seq_manager::start ( seq_action action,
const seq_scope_policy & scope_policy = {} )

Starts a new action and associates it with the specified scope policy.

Parameters
actionThe action to start.
scope_policyThe scoping policy for the action (default is empty).
Returns
The unique ID of the started action.

Definition at line 9 of file seq_manager.cpp.

◆ stop()

void seq::seq_manager::stop ( seq_id_t id)

Stops the action associated with the specified ID.

Parameters
idThe ID of the action to stop.

Definition at line 63 of file seq_manager.cpp.

◆ stop_all()

void seq::seq_manager::stop_all ( const std::string & scope = {})

Stops all actions within the specified scope.

Parameters
scopeThe name of the scope (default is all scopes).

Definition at line 78 of file seq_manager.cpp.

◆ stop_and_finish()

void seq::seq_manager::stop_and_finish ( seq_id_t id,
duration_t finish_after = 0ms )

Stops an action and ensures it completes after the specified duration.

Parameters
idThe ID of the action to stop.
finish_afterThe duration to wait before stopping (default is 0ms).

Definition at line 153 of file seq_manager.cpp.

◆ stop_and_finish_all()

void seq::seq_manager::stop_and_finish_all ( const std::string & scope = {})

Stops all actions in the specified scope and ensures they complete.

Parameters
scopeThe name of the scope (default is all scopes).

Definition at line 192 of file seq_manager.cpp.

◆ stop_when_finished()

void seq::seq_manager::stop_when_finished ( seq_id_t id)

Marks an action to stop when it finishes.

Parameters
idThe ID of the action to mark.

Definition at line 133 of file seq_manager.cpp.

◆ stop_when_finished_all()

void seq::seq_manager::stop_when_finished_all ( const std::string & scope = {})

Marks all actions in the specified scope to stop when they finish.

Parameters
scopeThe name of the scope (default is all scopes).

Definition at line 142 of file seq_manager.cpp.

◆ update() [1/2]

void seq::seq_manager::update ( duration_t delta)

Updates all managed actions with a time delta.

Parameters
deltaThe time delta to apply.

Definition at line 312 of file seq_manager.cpp.

◆ update() [2/2]

void seq::seq_manager::update ( seq_id_t id,
duration_t delta )

Updates the elapsed time of a specific action.

Parameters
idThe ID of the action.
deltaThe time delta to apply.

Definition at line 292 of file seq_manager.cpp.


The documentation for this struct was generated from the following files: