33 namespace SourceCatalog {
36 template <
typename From>
48 template <
typename From>
53 template <
typename From>
55 throw Elements::Exception() <<
"Only std::string and int64_t are supported types for a source ID, got " 56 <<
typeid(From).name() <<
" instead";
60 CatalogFromTable::CatalogFromTable(
62 const string& source_id_column_name,
66 if (source_id_index_ptr ==
nullptr) {
67 throw Elements::Exception() <<
"Column info does not have the column " << source_id_column_name;
69 m_source_id_index = *(source_id_index_ptr);
71 m_attribute_from_row_ptr_vector =
std::move(
72 attribute_from_row_ptr_vector);
75 CatalogFromTable::~CatalogFromTable() {
88 for (
auto row : input_table) {
90 auto source_id = boost::apply_visitor(castVisitor, row[m_source_id_index]);
94 for (
auto& attribute_from_table_ptr : m_attribute_from_row_ptr_vector) {
96 attribute_from_table_ptr->createAttribute(row));
102 return Catalog { source_vector };
boost::variant< int64_t, std::string > id_type
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.
static constexpr bool is_integer()