MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Core::SubsystemManager Class Reference

Central coordinator for all subsystems in the MayaFlux processing architecture. More...

#include <SubsystemManager.hpp>

+ Collaboration diagram for MayaFlux::Core::SubsystemManager:

Public Member Functions

 SubsystemManager (std::shared_ptr< Nodes::NodeGraphManager > node_graph_manager, std::shared_ptr< Buffers::BufferManager > buffer_manager, std::shared_ptr< Vruta::TaskScheduler > task_scheduler, std::shared_ptr< Core::WindowManager > window_manager=nullptr)
 Constructs SubsystemManager with required processing managers.
 
template<typename SType , typename... Args>
void create_subsystem_internal (SubsystemType type, Args &&... args)
 Internal template method for type-safe subsystem creation.
 
void create_audio_subsystem (GlobalStreamInfo &stream_info, Utils::AudioBackendType backend_type)
 Create and register the audio subsystem.
 
void create_graphics_subsystem (const GlobalGraphicsConfig &graphics_config)
 Create and register the graphics subsystem.
 
void start_all_subsystems ()
 Start all registered subsystems in coordination.
 
void pause_all_subsystems ()
 Pause all subsystems.
 
void resume_all_subsystems ()
 Resume all paused subsystems.
 
std::shared_ptr< ISubsystemget_subsystem (SubsystemType type)
 Get access to a specific subsystem by type.
 
std::shared_ptr< AudioSubsystemget_audio_subsystem ()
 Get typed access to the audio subsystem.
 
std::shared_ptr< GraphicsSubsystemget_graphics_subsystem ()
 Get typed access to the graphics subsystem.
 
bool has_subsystem (SubsystemType type) const
 Check if a subsystem type exists.
 
std::vector< SubsystemTypeget_active_subsystem_types () const
 Get all currently active subsystem types.
 
void add_subsystem (SubsystemType type, const std::shared_ptr< ISubsystem > &subsystem)
 Register a subsystem instance with the manager.
 
void remove_subsystem (SubsystemType type)
 Remove and shutdown a subsystem.
 
std::unordered_map< SubsystemType, std::pair< bool, bool > > query_subsystem_status () const
 Query operational status of all subsystems.
 
template<typename Func >
void execute_with_combined_tokens (SubsystemTokens primary_tokens, SubsystemTokens, Func operation)
 Execute an operation with temporary elevated permissions.
 
void shutdown ()
 Shutdown all subsystems in proper order.
 
void allow_cross_access (SubsystemType from, SubsystemType to)
 Configure cross-subsystem data access permissions.
 
std::optional< std::span< const double > > read_cross_subsystem_buffer (SubsystemType requesting_type, SubsystemType target_type, uint32_t channel)
 Read data from another subsystem's buffers.
 
void register_process_hook (SubsystemType type, const std::string &name, ProcessHook hook, HookPosition position=HookPosition::POST_PROCESS)
 Register a processing hook for a specific subsystem.
 
void unregister_process_hook (SubsystemType type, const std::string &name)
 Remove a previously registered processing hook.
 
bool has_process_hook (SubsystemType type, const std::string &name)
 Check if a processing hook exists.
 
SubsystemProcessingHandleget_validated_handle (SubsystemType type) const
 Get processing handle with validation.
 

Private Member Functions

bool is_cross_access_allowed (SubsystemType from, SubsystemType to) const
 
SubsystemTokens get_tokens_for_type (SubsystemType type) const
 

Private Attributes

std::shared_ptr< Nodes::NodeGraphManagerm_node_graph_manager
 
std::shared_ptr< Buffers::BufferManagerm_buffer_manager
 
std::shared_ptr< Vruta::TaskSchedulerm_task_scheduler
 
std::shared_ptr< Core::WindowManagerm_window_manager
 
std::unordered_map< SubsystemType, std::shared_ptr< ISubsystem > > m_subsystems
 
std::unordered_map< SubsystemType, std::unique_ptr< SubsystemProcessingHandle > > m_handles
 
std::unordered_map< SubsystemType, std::unordered_set< SubsystemType > > m_cross_access_permissions
 
std::shared_mutex m_mutex
 Thread safety for subsystem operations.
 

Detailed Description

Central coordinator for all subsystems in the MayaFlux processing architecture.

Manages subsystem lifecycle, provides token-scoped processing handles, and coordinates cross-subsystem operations. Each subsystem receives a dedicated processing handle that ensures proper isolation and thread safety within its designated processing domain.

Key responsibilities:

  • Subsystem registration and lifecycle management
  • Processing handle creation and distribution
  • Cross-subsystem data access control
  • Coordinated startup and shutdown sequences

Definition at line 29 of file SubsystemManager.hpp.


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