4#include <unordered_map>
64 void stop_all(
const std::string& scope = {});
77 void pause_all(
const std::string& scope = {},
const std::string&
key = {});
90 void resume_all(
const std::string& scope = {},
const std::string&
key = {});
252 void start_action(seq_info& info);
262 std::vector<
std::
string> scopes_;
267 int32_t current_scope_idx_ = -1;
272 std::set<
std::pair<
std::
string,
std::
string>> paused_scopes_;
Provides a sequence-based action management system for controlling and scheduling actions.
size_t seq_id_t
Represents a unique identifier for sequence actions.
std::chrono::nanoseconds duration_t
Represents a duration in nanoseconds.
Represents an action within the sequence management system. Contains lifecycle events and management ...
Stores information about an action, including its state, depth, and associated scopes.
uint32_t depth
The depth of the action in a sequence hierarchy.
seq_action action
The action being managed.
std::vector< std::string > scopes
The scopes associated with the action.
Manages and coordinates multiple sequence actions with scoping, pausing, and updating capabilities.
void resume(seq_id_t id)
Resumes the action associated with the specified ID.
void close_scope(const std::string &scope)
Closes a scope, removing it from the stack.
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.
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 resume_all(const std::string &scope={}, const std::string &key={})
Resumes all actions within the specified scope and key.
auto is_stopping(seq_id_t id) const -> bool
Checks if an action is stopping.
void push_scope(const std::string &scope)
Pushes a scope onto the scope stack.
auto is_finished(seq_id_t id) const -> bool
Checks if an action has finished.
auto get_overflow(seq_id_t id) const -> duration_t
Gets the overflow time of an action.
void stop_and_finish_all(const std::string &scope={})
Stops all actions in the specified scope and ensures they complete.
auto get_current_scope() const -> const std::string &
Gets the current scope from the scope stack.
void clear_scopes()
Clears all scopes from the scope stack.
void stop_all(const std::string &scope={})
Stops all actions within the specified scope.
auto get_speed_multiplier(seq_id_t id) -> float
Gets the speed multiplier of an action.
auto get_scopes() const -> const std::vector< std::string > &
Gets the list of all active scopes.
auto is_paused(seq_id_t id) const -> bool
Checks if an action is paused.
void set_elapsed(seq_id_t id, duration_t elapsed)
Sets the elapsed time of an action (use with caution).
void set_speed_multiplier(seq_id_t id, float speed_multiplier=1.0f)
Sets the speed multiplier for an action.
void pause_all(const std::string &scope={}, const std::string &key={})
Pauses all actions within the specified scope and key.
void pause(seq_id_t id)
Pauses the action associated with the specified ID.
void update(seq_id_t id, duration_t delta)
Updates the elapsed time of a specific action.
void stop_when_finished_all(const std::string &scope={})
Marks all actions in the specified scope to stop when they finish.
auto get_actions() const -> const action_collection_t &
Gets the collection of all managed actions.
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.
std::map< seq_id_t, seq_info > action_collection_t
Alias for the collection of actions managed by the seq_manager.
void stop_when_finished(seq_id_t id)
Marks an action to stop when it finishes.
bool has_action_with_scope(const std::string &scope_id)
Checks if there is any action associated with the specified scope ID.
void pop_scope()
Pops the current scope from the scope stack.
void stop(seq_id_t id)
Stops the action associated with the specified ID.
auto is_running(seq_id_t id) const -> bool
Checks if an action is running.
Defines policies for scoping actions in a sequence.