1+ /* * Copyright © 2019-2025 Université de Genève, LMU Munich - Faculty of Physics, IAP-CNRS/Sorbonne Université
2+ *
3+ * This library is free software; you can redistribute it and/or modify it under
4+ * the terms of the GNU Lesser General Public License as published by the Free
5+ * Software Foundation; either version 3.0 of the License, or (at your option)
6+ * any later version.
7+ *
8+ * This library is distributed in the hope that it will be useful, but WITHOUT
9+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11+ * details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this library; if not, write to the Free Software Foundation, Inc.,
15+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16+ */
17+
18+ #include " SEImplementation/Configuration/FileManagerConfig.h"
19+
20+ #include < boost/algorithm/string.hpp>
21+
22+ #include " ElementsKernel/Exception.h"
23+ #include " Configuration/ConfigManager.h"
24+
25+ #include " SEFramework/FITS/FitsImageSource.h"
26+
27+ #include < iostream>
28+
29+ using namespace Euclid ::Configuration;
30+ namespace po = boost::program_options;
31+
32+ namespace SourceXtractor {
33+
34+ static const std::string MAX_SIMULTANEOUS_FILES {" max-simultaneous-files" };
35+
36+
37+ // Constructor
38+ FileManagerConfig::FileManagerConfig (long manager_id)
39+ : Configuration(manager_id), m_max_simultaneous_files(500 ) {
40+ }
41+
42+ std::map<std::string, Configuration::OptionDescriptionList> FileManagerConfig::getProgramOptions () {
43+ return { {" File Manager" , {
44+ {MAX_SIMULTANEOUS_FILES .c_str (), po::value<int >()->default_value (500 ),
45+ " Maximum number of simultaneous open files." }
46+ }} };
47+ }
48+
49+ void FileManagerConfig::preInitialize (const UserValues& args) {
50+ // We have to configure the FileManager before any other configuration tries to use it
51+ m_max_simultaneous_files = args.find (MAX_SIMULTANEOUS_FILES )->second .as <int >();
52+ FitsImageSource::getFileManager (m_max_simultaneous_files);
53+ }
54+
55+ void FileManagerConfig::initialize (const UserValues& args) {
56+ }
57+
58+ } // namespace SourceXtractor
0 commit comments