Alexandria 2.32.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
ColumnInfo.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
24
25#ifndef TABLE_COLUMNINFO_H
26#define TABLE_COLUMNINFO_H
27
28#include <memory>
29#include <string>
30#include <typeindex>
31#include <utility>
32#include <vector>
33
34#include "ElementsKernel/Export.h"
35
37
38namespace Euclid {
39namespace Table {
40
53
54public:
56
75 explicit ColumnInfo(std::vector<info_type> info_list);
76
78 virtual ~ColumnInfo() = default;
79
87 bool operator==(const ColumnInfo& other) const;
88
96 bool operator!=(const ColumnInfo& other) const;
97
104 std::size_t size() const;
105
116 const ColumnDescription& getDescription(std::size_t index) const;
117
128 const ColumnDescription& getDescription(const std::string& name) const;
129
139
140private:
142};
143
144} // namespace Table
145} // end of namespace Euclid
146
147#endif /* TABLE_COLUMNINFO_H */
Contains the description of a specific column of a Table.
std::unique_ptr< std::size_t > find(const std::string &name) const
Returns the index of a column, given the name of it, or nullptr if there is no column with this name.
bool operator==(const ColumnInfo &other) const
Returns true if this ColumnInfo represents the same columns with the given one.
const ColumnDescription & getDescription(std::size_t index) const
Returns the description of the column with the given index or throws an exception if the index is big...
ColumnDescription info_type
Definition ColumnInfo.h:55
std::size_t size() const
Returns the number of columns represented by this ColumnInfo.
std::vector< info_type > m_info_list
Definition ColumnInfo.h:141
bool operator!=(const ColumnInfo &other) const
Returns false if this ColumnInfo represents the same columns with the given one.
virtual ~ColumnInfo()=default
Default destructor.
ColumnInfo(std::vector< info_type > info_list)
Constructs a ColumnInfo representing the given column names and types.
#define ELEMENTS_API