MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::IO::WriterRegistry< Writer > Class Template Reference

Singleton registry dispatching single-shot writes by file extension. More...

#include <WriterRegistry.hpp>

+ Collaboration diagram for MayaFlux::IO::WriterRegistry< Writer >:

Public Member Functions

std::unique_ptr< Writer > create_writer (const std::string &filepath) const
 
std::vector< std::string > get_registered_extensions () const
 
void register_writer (const std::vector< std::string > &extensions, const WriterFactory< Writer > &factory)
 

Static Public Member Functions

static WriterRegistry & instance ()
 

Private Attributes

std::unordered_map< std::string, WriterFactory< Writer > > m_factories
 

Detailed Description

template<typename Writer>
class MayaFlux::IO::WriterRegistry< Writer >

Singleton registry dispatching single-shot writes by file extension.

Shared by every single-shot writer family (ImageWriter, ModelWriter, VolumeWriter, ...). Concrete writers register themselves during subsystem init via register_writer(); create_writer(path) looks up the extension and returns a fresh instance, or nullptr if none is registered.

The nullptr is the whole point of the indirection: a format whose backing library is not present on a given build simply has no entry, and the caller gets a logged miss at the call site rather than a link error at startup.

Template Parameters
WriterAbstract single-shot writer type this registry dispatches.

Definition at line 25 of file WriterRegistry.hpp.


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