Alexandria  2.16
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CatalogConfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2020 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 
25 #include <memory>
26 #include <vector>
27 #include <functional>
28 #include <boost/filesystem.hpp>
29 #include "Table/Table.h"
30 #include "Table/TableReader.h"
31 #include "SourceCatalog/Catalog.h"
34 
35 namespace Euclid {
36 namespace Configuration {
37 
66 class CatalogConfig : public Configuration {
67 
68 public:
69 
73 
75  explicit CatalogConfig(long manager_id);
76 
78  virtual ~CatalogConfig() = default;
79 
96 
111  void preInitialize(const UserValues& args) override;
112 
129  void initialize(const UserValues& args) override;
130 
144  void setBaseDir(const boost::filesystem::path& base_dir);
145 
161 
163 
165 
166  std::string getIdColumn() const;
167 
169 
191  Table::Table readAsTable() const;
192 
215 
229  const boost::filesystem::path& getFilename() const;
230 
231 private:
232 
233  boost::filesystem::path m_base_dir {};
234  boost::filesystem::path m_filename {};
235  bool m_fits_format {true};
239 
240 }; /* End of CatalogConfig class */
241 
242 } /* namespace Configuration */
243 } /* namespace Euclid */
244 
245 #endif
SourceCatalog::Catalog readAsCatalog() const
Returns the Catalog object.
Configuration class for enabling catalog input.
Definition: CatalogConfig.h:66
TableToCatalogConverter getTableToCatalogConverter() const
Superclass of all configuration classes.
Definition: Configuration.h:45
void addAttributeHandler(std::shared_ptr< SourceCatalog::AttributeFromRow > handler)
Adds an attribute handler which will be used for adding attributes at the catalog objects...
std::shared_ptr< Table::ColumnInfo > getColumnInfo() const
STL class.
STL class.
boost::filesystem::path m_base_dir
void initialize(const UserValues &args) override
Initializes the CatalogConfig instance.
virtual ~CatalogConfig()=default
Destructor.
std::vector< std::shared_ptr< SourceCatalog::AttributeFromRow > > m_attribute_handlers
void preInitialize(const UserValues &args) override
Checks that all the options are valid. See the exceptions thrown for a detailed list of the checks...
void setBaseDir(const boost::filesystem::path &base_dir)
Sets the directory used when resolving relative paths.
Represents a table.
Definition: Table.h:49
Table::Table readAsTable() const
Returns the catalog as a Table::Table object.
STL class.
STL class.
const boost::filesystem::path & getFilename() const
Returns the filename of the input catalog.
std::unique_ptr< Table::TableReader > getTableReader() const
boost::filesystem::path m_filename
CatalogConfig(long manager_id)
Constructs a new CatalogConfig object.
std::shared_ptr< Table::ColumnInfo > m_column_info
Catalog contains a container of sources.
Definition: Catalog.h:47
std::map< std::string, OptionDescriptionList > getProgramOptions() override
Returns the program options defined by the CatalogConfig.