31 #include <boost/variant.hpp> 41 namespace SourceCatalog {
51 typedef boost::variant<int64_t, std::string>
id_type;
60 Source(
id_type source_id, std::vector<std::shared_ptr<Attribute>> attributeVector)
110 template <
typename From>
112 return std::is_integral<From>::value && !std::is_same<From, bool>::value;
122 template <
typename From>
127 template <
typename From>
129 throw Elements::Exception() <<
"Only std::string and int64_t are supported types for a source ID, got " 130 <<
typeid(From).name() <<
" instead";
141 #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.
virtual ~Source()
Virtual default destructor.
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...
std::vector< std::shared_ptr< Attribute > > m_attribute_vector
Source::id_type operator()(const std::string &from) 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...
The Source class includes all information related to a sky source.
id_type getId() const
Get the source ID.
static constexpr bool is_integer()