28 #include <boost/variant.hpp>
41 namespace 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
boost::variant< int64_t, std::string > id_type
Source(id_type source_id, std::vector< std::shared_ptr< Attribute >> attributeVector)
Constructor.
This type can be used together with boost::apply_visitor to cast boost::variant with an unknown under...
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...
Source::id_type operator()(const From &, typename std::enable_if<!is_integer< From >()>::type *=0) const
virtual ~Source()=default
Virtual default destructor.
CastSourceIdVisitor()=default
id_type getId() const
Get the source ID.
std::vector< std::shared_ptr< Attribute > > m_attribute_vector
Source::id_type operator()(const std::string &from) const
The Source class includes all information related to a sky source.
Source::id_type operator()(const From &from, typename std::enable_if< is_integer< From >()>::type *=0) const
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...
static constexpr bool is_integer()