...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A non-owning read-only reference to a sequence of rows.
Defined in header <boost/mysql/rows_view.hpp>
class rows_view
Name |
Description |
---|---|
A random access iterator to an element. |
|
The reference type. |
|
A signed integer type used to represent differences. |
|
A random access iterator to an element. |
|
The reference type. |
|
An unsigned integer type to represent sizes. |
|
A type that can hold elements in this collection with value semantics. |
Name |
Description |
---|---|
Returns the i-th row or throws an exception. |
|
Returns the last row. |
|
Returns an iterator to the first element in the collection. |
|
Returns true if there are no rows in the collection (i.e. |
|
Returns an iterator to one-past-the-last element in the collection. |
|
Returns the first row. |
|
Returns the number of elements each row in the collection has. |
|
Returns the i-th row (unchecked access). |
|
Equality operator. |
|
Inequality operator. |
|
rows_view [constructor] |
Construct an empty (but valid) view. |
Returns the number of rows in the collection. |
Models a non-owning matrix-like container. Indexing a rows_view
object (by using iterators, rows_view::at
or rows_view::operator[]
)
returns a row_view
object, representing a
single row. All rows in the collection are the same size (as given by num_columns
).
A rows_view
object points
to memory owned by an external entity (like string_view
does). The validity of a rows_view
object depends on how it was obtained:
rows
object (by calling rows::operator rows_view()
), the view acts as a reference
to the rows
' allocated
memory, and is valid as long as references to that rows
elements are valid.
connection::read_some_rows
it's valid until
the connection
performs
the next network call or is destroyed.
row_view
's
and field_view
's
obtained by using a rows_view
object are valid as long as the underlying storage that *this
points to is valid. Destroying *this
doesn't
invalidate such references.
Calling any member function on an invalid view results in undefined behavior.
Instances of this class are usually created by the library, not by the user.