SQL row metadata.
More...
#include <sql_row_metadata.h>
|
using | const_iterator |
| key is the column name, value is the column index.
|
SQL row metadata.
Definition at line 31 of file sql_row_metadata.h.
◆ const_iterator
Initial value:
std::unordered_map<std::string, std::size_t>::const_iterator
key is the column name, value is the column index.
Definition at line 37 of file sql_row_metadata.h.
◆ sql_row_metadata()
hazelcast::client::sql::sql_row_metadata::sql_row_metadata |
( |
std::vector< sql_column_metadata > | columns | ) |
|
|
explicit |
Definition at line 1264 of file sql.cpp.
1265 : columns_(std::move(
columns))
1266{
1267 assert(!columns_.empty());
1268
1269 name_to_index_.reserve(columns_.size());
1270 for (std::size_t i = 0; i < columns_.size(); ++i) {
1271 name_to_index_.emplace(columns_[i].name, i);
1272 }
1273}
◆ column()
const sql_column_metadata & hazelcast::client::sql::sql_row_metadata::column |
( |
std::size_t | index | ) |
const |
Gets column metadata.
- Parameters
-
index | column index, zero-based |
- Returns
- column metadata
- Exceptions
-
IndexOutOfBoundsException | If the column index is out of bounds |
Definition at line 1282 of file sql.cpp.
1283{
1284 if (index >= columns_.size()) {
1285 throw exception::index_out_of_bounds(
1286 "sql_row_metadata::column(std::size_t index)",
1287 (boost::format("Column index is out of bounds: %1%") % index).str());
1288 }
1289
1290 return columns_[index];
1291}
◆ column_count()
std::size_t hazelcast::client::sql::sql_row_metadata::column_count |
( |
| ) |
const |
Gets the number of columns in the row.
- Returns
- the number of columns in the row
Definition at line 1276 of file sql.cpp.
1277{
1278 return columns_.size();
1279}
◆ columns()
const std::vector< sql_column_metadata > & hazelcast::client::sql::sql_row_metadata::columns |
( |
| ) |
const |
Gets columns metadata.
- Returns
- columns metadata
Definition at line 1294 of file sql.cpp.
1295{
1296 return columns_;
1297}
◆ end()
Constant indicating that the column is not found.
Definition at line 1306 of file sql.cpp.
1307{
1308 return name_to_index_.end();
1309}
◆ find_column()
Find index of the column with the given name.
Returned index can be used to get column value from sql_row.
- Parameters
-
column_name | column name (case sensitive) |
- Returns
- the iterator pointing to the found item or end() if not found.
- See also
- sql_row
Definition at line 1300 of file sql.cpp.
1301{
1302 return name_to_index_.find(column_name);
1303}
◆ operator==
Definition at line 1311 of file sql.cpp.
1312{
1313 return lhs.columns_ == rhs.columns_;
1314}
The documentation for this class was generated from the following files: