Alexandria
2.19
Please provide a description of the project.
SourceCatalog
SourceCatalog
Catalog.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012-2021 Euclid Science Ground Segment
3
*
4
* This library is free software; you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License as published by the Free
6
* Software Foundation; either version 3.0 of the License, or (at your option)
7
* any later version.
8
*
9
* This library is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12
* details.
13
*
14
* You should have received a copy of the GNU Lesser General Public License
15
* along with this library; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
27
#ifndef CATALOG_H_
28
#define CATALOG_H_
29
30
#include <map>
31
#include <memory>
32
33
#include "
ElementsKernel/Export.h
"
34
35
#include "
SourceCatalog/Source.h
"
36
37
namespace
Euclid
{
38
namespace
SourceCatalog {
39
47
class
ELEMENTS_API
Catalog
{
48
49
public
:
63
explicit
Catalog
(
std::vector<Source>
source_vector);
64
65
typedef
std::vector<Source>::const_iterator
const_iterator
;
66
70
virtual
~Catalog
() =
default
;
71
80
const_iterator
begin
()
const
{
81
return
m_source_vector.cbegin();
82
}
83
92
const_iterator
end
()
const
{
93
return
m_source_vector.cend();
94
}
95
105
std::shared_ptr<Source>
find(
const
Source::id_type
& source_id)
const
;
106
113
size_t
size
()
const
{
114
return
m_source_vector.size();
115
}
116
117
private
:
118
// Vector of Source objects
119
std::vector<Source>
m_source_vector{};
120
// Map of the Source identification and their location
121
// in the Source vector
122
std::map<Source::id_type, size_t>
m_source_index_map{};
123
};
124
125
}
/* namespace SourceCatalog */
126
}
// end of namespace Euclid
127
128
#endif
/* CATALOG_H_ */
std::shared_ptr
STL class.
Export.h
std::vector
STL class.
Source.h
Euclid::SourceCatalog::Catalog
Catalog contains a container of sources.
Definition:
Catalog.h:47
Euclid::SourceCatalog::Catalog::~Catalog
virtual ~Catalog()=default
Destructor.
ELEMENTS_API
#define ELEMENTS_API
std::map< Source::id_type, size_t >
Euclid::SourceCatalog::Catalog::end
const_iterator end() const
Get an const_iterator pointing to the last element in the m_source_vector vector.
Definition:
Catalog.h:92
Euclid::SourceCatalog::Source::id_type
boost::variant< int64_t, std::string > id_type
Definition:
Source.h:51
Euclid::SourceCatalog::Catalog::begin
const_iterator begin() const
Get a const_iterator pointing to the first element in the m_source_vector vector.
Definition:
Catalog.h:80
Euclid::SourceCatalog::Catalog::size
size_t size() const
Get the size of the vector container.
Definition:
Catalog.h:113
Euclid
Definition:
InstOrRefHolder.h:29
Euclid::SourceCatalog::Catalog::const_iterator
std::vector< Source >::const_iterator const_iterator
Definition:
Catalog.h:65
Generated by
1.8.20