Alexandria
2.14.1
Please provide a description of the project.
XYDataset
XYDataset
QualifiedName.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012-2020 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
25
#ifndef PHZDATAMODEL_QUALIFIEDNAME_H
26
#define PHZDATAMODEL_QUALIFIEDNAME_H
27
28
#include <string>
29
#include <vector>
30
#include <functional>
31
#include <iostream>
32
33
#include "
ElementsKernel/Export.h
"
34
35
namespace
Euclid
{
36
namespace
XYDataset {
37
66
class
ELEMENTS_API
QualifiedName
{
67
68
public
:
69
82
QualifiedName
(
std::vector<std::string>
groups,
std::string
name);
83
93
QualifiedName
(
const
std::string
& );
94
98
QualifiedName
(
const
QualifiedName
&) =
default
;
99
104
QualifiedName
& operator=(
const
QualifiedName
& ) =
default
;
105
109
QualifiedName
(
QualifiedName
&& ) =
default
;
110
115
QualifiedName
& operator=(
QualifiedName
&&) =
default
;
116
120
virtual
~
QualifiedName
() =
default
;
121
126
const
std::vector<std::string>
& groups()
const
;
127
132
const
std::string
& datasetName()
const
;
133
141
const
std::string
& qualifiedName()
const
;
142
144
bool
belongsInGroup(
const
QualifiedName
& group)
const
;
145
150
size_t
hash()
const
;
151
161
bool
operator<(
const
QualifiedName
& other)
const
;
162
170
bool
operator==(
const
QualifiedName
& other)
const
;
171
179
bool
operator!=
(
const
QualifiedName
& other)
const
;
180
188
struct
AlphabeticalComparator
{
189
bool
operator()
(
const
QualifiedName
& a,
const
QualifiedName
& b)
const
{
190
if
(a.
qualifiedName
().
compare
(b.
qualifiedName
()) < 0) {
191
return
true
;
192
}
else
{
193
return
false
;
194
}
195
}
196
};
197
198
private
:
199
200
std::vector<std::string>
m_groups
;
201
std::string
m_dataset_name
;
202
std::string
m_qualified_name
;
203
mutable
size_t
m_hash {0};
204
205
};
// class QualifiedName
206
207
209
std::ostream
&
operator<<
(
std::ostream
& stream,
const
QualifiedName& qualified_name);
210
211
212
}
// namespace XYDataset
213
}
// end of namespace Euclid
214
215
namespace
std
{
216
226
template
<>
227
struct
hash
<
Euclid
::XYDataset::QualifiedName> {
228
size_t
operator()
(
const
Euclid::XYDataset::QualifiedName
& qualifiedName)
const
{
229
return
qualifiedName.
hash
();
230
}
231
};
232
233
}
// namespace std
234
235
#endif // PHZDATAMODEL_QUALIFIEDNAME_H
Euclid::XYDataset::QualifiedName::AlphabeticalComparator
Provides alphabetical comparison for the QualifiedNames a and b.
Definition:
QualifiedName.h:188
Export.h
Euclid::XYDataset::QualifiedName::AlphabeticalComparator::operator()
bool operator()(const QualifiedName &a, const QualifiedName &b) const
Definition:
QualifiedName.h:189
std::string
STL class.
std::vector< std::string >
Euclid::XYDataset::QualifiedName
Represents a name qualified with a set of groups.
Definition:
QualifiedName.h:66
Euclid::XYDataset::QualifiedName::qualifiedName
const std::string & qualifiedName() const
Returns the qualified name as a string.
Definition:
QualifiedName.cpp:73
boost::operator!=
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...
Definition:
Source.h:118
Euclid::XYDataset::QualifiedName::m_dataset_name
std::string m_dataset_name
Definition:
QualifiedName.h:201
Euclid::XYDataset::operator<<
std::ostream & operator<<(std::ostream &stream, const QualifiedName &qualified_name)
Make the QualifiedName streamable.
Definition:
QualifiedName.cpp:119
ELEMENTS_API
#define ELEMENTS_API
std::ostream
STL class.
std::string::compare
T compare(T... args)
Euclid::XYDataset::QualifiedName::m_groups
std::vector< std::string > m_groups
Definition:
QualifiedName.h:200
std::hash< Euclid::XYDataset::QualifiedName >::operator()
size_t operator()(const Euclid::XYDataset::QualifiedName &qualifiedName) const
Definition:
QualifiedName.h:228
Euclid::XYDataset::QualifiedName::m_qualified_name
std::string m_qualified_name
Definition:
QualifiedName.h:202
std
STL namespace.
Euclid
Definition:
InstOrRefHolder.h:29
Euclid::XYDataset::QualifiedName::hash
size_t hash() const
Returns the hash value of the QualifiedName.
Definition:
QualifiedName.cpp:87
std::hash
Generated by
1.8.17