SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
OutputFactory.cpp
Go to the documentation of this file.
1
22#include <system_error>
23#include <iostream>
24#include <fstream>
25#include <system_error>
26#include <CCfits/CCfits>
27
29
31
36
38
39namespace SourceXtractor {
40
58
62
64 auto& output_config = manager.getConfiguration<OutputConfig>();
65 m_output_properties = output_config.getOutputProperties();
66 m_flush_size = output_config.getFlushSize();
67 m_output_filename = output_config.getOutputFile();
68 m_output_format = output_config.getOutputFileFormat();
69
70 if (m_output_filename != "") {
71 // Check if we can, at least, create it.
72 // Otherwise, the error will be triggered only at the end of the full process!
73 std::ofstream check_writeable{m_output_filename};
74 if (!check_writeable) {
76 std::system_error(errno, std::system_category(), "Failed to open the output catalog").what());
77 }
78 }
79}
80
81} // SourceXtractor namespace
82
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
OutputConfig::OutputFileFormat m_output_format
std::shared_ptr< OutputRegistry > m_output_registry
std::vector< std::string > m_output_properties
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
std::shared_ptr< Output > createOutput() const
T make_shared(T... args)
std::unique_ptr< T > make_unique(Args &&... args)
T system_category(T... args)