Alexandria  2.19
Please provide a description of the project.
CatalogConfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2021 Euclid Science Ground Segment
3  *
4  * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
5  * Public License as published by the Free 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 ANY WARRANTY; without even the implied
9  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
10  * details.
11  *
12  * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
13  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14  */
15 
22 #ifndef _CONFIGURATION_CATALOGCONFIG_H
23 #define _CONFIGURATION_CATALOGCONFIG_H
24 
27 #include "SourceCatalog/Catalog.h"
28 #include "Table/Table.h"
29 #include "Table/TableReader.h"
30 #include <boost/filesystem.hpp>
31 #include <functional>
32 #include <memory>
33 #include <vector>
34 
35 namespace Euclid {
36 namespace Configuration {
37 
66 class CatalogConfig : public Configuration {
67 
68 public:
72 
74  explicit CatalogConfig(long manager_id);
75 
77  virtual ~CatalogConfig() = default;
78 
95 
110  void preInitialize(const UserValues& args) override;
111 
128  void initialize(const UserValues& args) override;
129 
143  void setBaseDir(const boost::filesystem::path& base_dir);
144 
160 
166 
172 
177  std::string getIdColumn() const;
178 
184 
206  Table::Table readAsTable() const;
207 
230 
244  const boost::filesystem::path& getFilename() const;
245 
246 private:
247  boost::filesystem::path m_base_dir;
248  boost::filesystem::path m_filename;
249  bool m_fits_format = true;
253 
254 }; /* End of CatalogConfig class */
255 
256 } /* namespace Configuration */
257 } /* namespace Euclid */
258 
259 #endif
Euclid::Configuration::CatalogConfig::m_attribute_handlers
std::vector< std::shared_ptr< SourceCatalog::AttributeFromRow > > m_attribute_handlers
Definition: CatalogConfig.h:251
Euclid::Configuration::CatalogConfig::m_filename
boost::filesystem::path m_filename
Definition: CatalogConfig.h:248
std::string
STL class.
Euclid::Configuration::CatalogConfig::m_column_info
std::shared_ptr< Table::ColumnInfo > m_column_info
Definition: CatalogConfig.h:252
std::shared_ptr
STL class.
TableReader.h
Euclid::Configuration::CatalogConfig::getProgramOptions
std::map< std::string, OptionDescriptionList > getProgramOptions() override
Returns the program options defined by the CatalogConfig.
Definition: CatalogConfig.cpp:48
Euclid::Configuration::CatalogConfig::m_base_dir
boost::filesystem::path m_base_dir
Definition: CatalogConfig.h:247
Euclid::Configuration::CatalogConfig::initialize
void initialize(const UserValues &args) override
Initializes the CatalogConfig instance.
Definition: CatalogConfig.cpp:153
std::vector
STL class.
std::function
Euclid::Configuration::CatalogConfig::~CatalogConfig
virtual ~CatalogConfig()=default
Destructor.
Euclid::SourceCatalog::Catalog
Catalog contains a container of sources.
Definition: Catalog.h:47
Euclid::Configuration::CatalogConfig::preInitialize
void preInitialize(const UserValues &args) override
Checks that all the options are valid. See the exceptions thrown for a detailed list of the checks.
Definition: CatalogConfig.cpp:57
AttributeFromRow.h
Catalog.h
Euclid::Configuration::CatalogConfig::m_fits_format
bool m_fits_format
Definition: CatalogConfig.h:249
Euclid::Configuration::CatalogConfig::readAsCatalog
SourceCatalog::Catalog readAsCatalog() const
Returns the Catalog object.
Definition: CatalogConfig.cpp:226
Euclid::Configuration::CatalogConfig
Configuration class for enabling catalog input.
Definition: CatalogConfig.h:66
Euclid::Configuration::CatalogConfig::addAttributeHandler
void addAttributeHandler(std::shared_ptr< SourceCatalog::AttributeFromRow > handler)
Adds an attribute handler which will be used for adding attributes at the catalog objects.
Definition: CatalogConfig.cpp:167
Euclid::Configuration::CatalogConfig::getIdColumn
std::string getIdColumn() const
Definition: CatalogConfig.cpp:188
Euclid::Configuration::CatalogConfig::getColumnInfo
std::shared_ptr< Table::ColumnInfo > getColumnInfo() const
Definition: CatalogConfig.cpp:181
std::map
STL class.
Euclid::Configuration::CatalogConfig::CatalogConfig
CatalogConfig(long manager_id)
Constructs a new CatalogConfig object.
Definition: CatalogConfig.cpp:46
Euclid::Configuration::CatalogConfig::readAsTable
Table::Table readAsTable() const
Returns the catalog as a Table::Table object.
Definition: CatalogConfig.cpp:218
Euclid::Configuration::CatalogConfig::getTableReader
std::unique_ptr< Table::TableReader > getTableReader() const
Definition: CatalogConfig.cpp:174
Euclid::Table::Table
Represents a table.
Definition: Table.h:49
Euclid::Configuration::Configuration
Superclass of all configuration classes.
Definition: Configuration.h:45
std::unique_ptr
STL class.
Euclid::Configuration::CatalogConfig::m_id_column_name
std::string m_id_column_name
Definition: CatalogConfig.h:250
Euclid
Definition: InstOrRefHolder.h:29
Euclid::Configuration::CatalogConfig::getTableToCatalogConverter
TableToCatalogConverter getTableToCatalogConverter() const
Definition: CatalogConfig.cpp:211
Table.h
Euclid::Configuration::CatalogConfig::getFilename
const boost::filesystem::path & getFilename() const
Returns the filename of the input catalog.
Definition: CatalogConfig.cpp:235
Configuration.h
Euclid::Configuration::CatalogConfig::setBaseDir
void setBaseDir(const boost::filesystem::path &base_dir)
Sets the directory used when resolving relative paths.
Definition: CatalogConfig.cpp:160