34 : m_info_list{std::move(info_list)} {
35 if (m_info_list.empty()) {
38 std::set<std::string>
set {};
39 for (
const auto& info : m_info_list) {
40 const auto& name = info.name;
41 if (!
set.insert(name).second) {
48 if (this->m_info_list.size() != other.
m_info_list.size()) {
51 return std::equal(this->m_info_list.cbegin(), this->m_info_list.cend(), other.
m_info_list.cbegin());
55 return !(*
this == other);
63 if (index >=
size()) {
71 [&name](
const info_type& info) {
return info.name == name; });
81 auto iter = std::find_if(begin, end, [&name](
const info_type& info){
return info.
name == name;});
83 size_t index {
static_cast<size_t>(std::distance(begin, iter))};
84 return std::unique_ptr<size_t> {
new size_t {index}};
86 return std::unique_ptr<size_t> {};
std::vector< info_type > m_info_list
std::size_t size() const
Returns the number of columns represented by this ColumnInfo.
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.
Provides information about the columns of a Table.
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...
ColumnInfo(std::vector< info_type > info_list)
Constructs a ColumnInfo representing the given column names and types.
bool operator!=(const ColumnInfo &other) const
Returns false if this ColumnInfo represents the same columns with the given one.
Contains the description of a specific column of a Table.