28#include <boost/variant.hpp>
41namespace SourceCatalog {
51 typedef boost::variant<int64_t, std::string>
id_type;
106 template <
typename From>
118 template <
typename From>
123 template <
typename From>
125 throw Elements::Exception() <<
"Only std::string and int64_t are supported types for a source ID, got "
126 <<
typeid(
From).name() <<
" instead";
137#if BOOST_VERSION < 105800
This type can be used together with boost::apply_visitor to cast boost::variant with an unknown under...
Source::id_type operator()(const From &, typename std::enable_if<!is_integer< From >()>::type *=0) const
static constexpr bool is_integer()
Source::id_type operator()(const std::string &from) const
CastSourceIdVisitor()=default
Source::id_type operator()(const From &from, typename std::enable_if< is_integer< From >()>::type *=0) const
Store the Right Ascension (Ra) and Delination (Dec) of a source in decimal degrees,...
The Source class includes all information related to a sky source.
virtual ~Source()=default
Virtual default destructor.
std::shared_ptr< T > getAttribute() const
Get a pointer to source attribute of type T or a null pointer if the source do not contain an attribu...
Source(id_type source_id, std::vector< std::shared_ptr< Attribute > > attributeVector)
Constructor.
id_type getId() const
Get the source ID.
std::vector< std::shared_ptr< Attribute > > m_attribute_vector
boost::variant< int64_t, std::string > id_type
bool operator!=(const Euclid::SourceCatalog::Source::id_type &a, const Euclid::SourceCatalog::Source::id_type &b)
boost::variant specifies an equality operator (==), but, in older boost versions, not an inequality o...