Alexandria 2.31.4
SDC-CH common library for the Euclid project
|
Catalog contains a container of sources. More...
#include <Catalog.h>
Public Types | |
typedef std::vector< Source >::const_iterator | const_iterator |
Public Member Functions | |
Catalog (const std::vector< Source > &source_vector) | |
Build a catalog of Source objects. | |
virtual | ~Catalog ()=default |
Destructor. | |
const_iterator | begin () const |
Get a const_iterator pointing to the first element in the m_source_vector vector. | |
const_iterator | end () const |
Get an const_iterator pointing to the last element in the m_source_vector vector. | |
std::shared_ptr< Source > | find (const Source::id_type &source_id) const |
Find the Source object from its identification number. | |
size_t | size () const |
Get the size of the vector container. |
Private Attributes | |
std::vector< Source > | m_source_vector {} |
std::map< Source::id_type, size_t > | m_source_index_map {} |
typedef std::vector<Source>::const_iterator Euclid::SourceCatalog::Catalog::const_iterator |
|
explicit |
Build a catalog of Source objects.
Constructs a vector container of Source objects, a map of source identification and an index which is the location of the Source object in the vector container
source_vector | Vector container of Source objects |
Elements::Exception | A Source object can not be inserted twice in the map |
Definition at line 36 of file Catalog.cpp.
References m_source_index_map, and m_source_vector.
|
virtualdefault |
Destructor.
|
inline |
Get a const_iterator pointing to the first element in the m_source_vector vector.
Definition at line 80 of file Catalog.h.
References m_source_vector.
|
inline |
Get an const_iterator pointing to the last element in the m_source_vector vector.
Definition at line 92 of file Catalog.h.
References m_source_vector.
std::shared_ptr< Source > Euclid::SourceCatalog::Catalog::find | ( | const Source::id_type & | source_id | ) | const |
Find the Source object from its identification number.
source_id | The source identification number |
Definition at line 52 of file Catalog.cpp.
References m_source_index_map, m_source_vector, and std::make_shared().
|
inline |
Get the size of the vector container.
Definition at line 113 of file Catalog.h.
References m_source_vector.
|
private |
|
private |