33 namespace SourceCatalog {
35 CatalogFromTable::CatalogFromTable(
37 const string& source_id_column_name,
41 if (source_id_index_ptr ==
nullptr) {
42 throw Elements::Exception() <<
"Column info does not have the column " << source_id_column_name;
44 m_source_id_index = *(source_id_index_ptr);
46 m_attribute_from_row_ptr_vector =
std::move(
47 attribute_from_row_ptr_vector);
50 CatalogFromTable::~CatalogFromTable() {
63 for (
auto row : input_table) {
65 auto source_id = boost::apply_visitor(castVisitor, row[m_source_id_index]);
69 for (
auto& attribute_from_table_ptr : m_attribute_from_row_ptr_vector) {
71 attribute_from_table_ptr->createAttribute(row));
77 return Catalog { source_vector };
This type can be used together with boost::apply_visitor to cast boost::variant with an unknown under...
std::unique_ptr< std::size_t > find(const std::string &name) const
Returns the index of a column, given the name of it, or nullptr if there is no column with this name.
The Source class includes all information related to a sky source.
Catalog contains a container of sources.