drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
drogon::orm::Row Class Reference

Reference to one row in a result. More...

#include <drogon/orm/Row.h>

Inheritance diagram for drogon::orm::Row:

Public Types

using SizeType = size_t
using Reference = Field
using ConstIterator = ConstRowIterator
using Iterator = ConstIterator
using ConstReverseIterator = ConstReverseRowIterator
using DifferenceType = long

Public Member Functions

Reference operator[] (SizeType index) const noexcept
Reference operator[] (int index) const noexcept
Reference operator[] (const char columnName[]) const
Reference operator[] (const std::string &columnName) const
Reference at (SizeType index) const
Reference at (const char columnName[]) const
Reference at (const std::string &columnName) const
SizeType size () const
SizeType capacity () const noexcept
ConstIterator begin () const noexcept
ConstIterator cbegin () const noexcept
ConstIterator end () const noexcept
ConstIterator cend () const noexcept
ConstReverseIterator rbegin () const
ConstReverseIterator crbegin () const
ConstReverseIterator rend () const
ConstReverseIterator crend () const
 Row (const Row &r) noexcept=default
 Row (Row &&) noexcept=default
Row & operator= (const Row &) noexcept=default

Protected Member Functions

 Row (const Result &r, SizeType index) noexcept

Protected Attributes

long index_ {0}
Row::SizeType end_ {0}

Friends

class Field
class Result

Detailed Description

Reference to one row in a result.

A row represents one row (also called a row) in a query result set. It also acts as a container mapping column numbers or names to field values (see below):

cout << row["date"].as<std::string>() << ": " <<
*row["name"].as<std::string>() << endl;

The row itself acts like a (non-modifyable) container, complete with its own const_iterator and const_reverse_iterator.

Member Data Documentation

◆ index_

long drogon::orm::Row::index_ {0}
protected

Row number You'd expect this to be a size_t, but due to the way reverse iterators are related to regular iterators, it must be allowed to underflow to -1.


The documentation for this class was generated from the following file:
  • orm_lib/inc/drogon/orm/Row.h