Registry for all file writers, enabling automatic discovery.
More...
#include <WriterFactory.hpp>
Registry for all file writers, enabling automatic discovery.
◆ WriterFactory()
| correlation::writers::WriterFactory::WriterFactory |
( |
| ) |
|
|
privatedefault |
◆ getWriter()
| BaseWriter * correlation::writers::WriterFactory::getWriter |
( |
const std::string & | name | ) |
|
Gets a writer by its name.
- Parameters
-
| name | The name of the writer. |
- Returns
- Pointer to the writer, or nullptr if not found.
◆ getWriterForExtension()
| BaseWriter * correlation::writers::WriterFactory::getWriterForExtension |
( |
const std::string & | extension | ) |
|
Finds a writer that supports the given file extension.
- Parameters
-
| extension | The file extension (e.g., ".csv"). |
- Returns
- A pointer to the writer instance, or nullptr if not found.
◆ getWriters()
| const std::vector< std::unique_ptr< BaseWriter > > & correlation::writers::WriterFactory::getWriters |
( |
| ) |
const |
Returns all registered writers.
- Returns
- Constant reference to the internal vector of writers.
◆ instance()
| WriterFactory & correlation::writers::WriterFactory::instance |
( |
| ) |
|
|
static |
◆ registerTypeSafe()
template<typename T>
| bool correlation::writers::WriterFactory::registerTypeSafe |
( |
const char * | name | ) |
|
|
inlinestaticnoexcept |
Exception-safe template helper for static auto-registration.
- Template Parameters
-
| T | The specific Writer class type to instantiate. |
- Parameters
-
| name | The human-readable name of the writer (for error logging). |
- Returns
- true if registration succeeded, false if an exception occurred.
◆ registerWriter()
| bool correlation::writers::WriterFactory::registerWriter |
( |
std::unique_ptr< BaseWriter > | writer | ) |
|
Registers a new writer.
- Parameters
-
| writer | Unique pointer to the writer instance. |
- Returns
- true if registration was successful.
◆ extension_map_
| std::map<std::string, BaseWriter *> correlation::writers::WriterFactory::extension_map_ |
|
private |
Lookup map for file extensions.
◆ name_map_
| std::map<std::string, BaseWriter *> correlation::writers::WriterFactory::name_map_ |
|
private |
Lookup map for format names.
◆ writers_
| std::vector<std::unique_ptr<BaseWriter> > correlation::writers::WriterFactory::writers_ |
|
private |
Storage for writer instances.
The documentation for this class was generated from the following files: