drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
Row.h
Go to the documentation of this file.
1
14
15// Taken from libpqxx and modified.
16// The license for libpqxx can be found in the COPYING file.
17
18#pragma once
19
20#include <drogon/exports.h>
21#include <drogon/orm/Result.h>
22#include <string>
23
24namespace drogon
25{
26namespace orm
27{
28class Field;
31
33
46class DROGON_EXPORT Row
47{
48 public:
49 using SizeType = size_t;
50 using Reference = Field;
51 using ConstIterator = ConstRowIterator;
52 using Iterator = ConstIterator;
53 using ConstReverseIterator = ConstReverseRowIterator;
54
55 using DifferenceType = long;
56
57 Reference operator[](SizeType index) const noexcept;
58 Reference operator[](int index) const noexcept;
59 Reference operator[](const char columnName[]) const;
60 Reference operator[](const std::string &columnName) const;
61
62 Reference at(SizeType index) const;
63 Reference at(const char columnName[]) const;
64 Reference at(const std::string &columnName) const;
65
66 SizeType size() const;
67
68 SizeType capacity() const noexcept
69 {
70 return size();
71 }
72
73 ConstIterator begin() const noexcept;
74 ConstIterator cbegin() const noexcept;
75 ConstIterator end() const noexcept;
76 ConstIterator cend() const noexcept;
77
78 ConstReverseIterator rbegin() const;
79 ConstReverseIterator crbegin() const;
80 ConstReverseIterator rend() const;
81 ConstReverseIterator crend() const;
82
83#ifdef _MSC_VER
84 Row() noexcept = default;
85#endif
86
87 Row(const Row &r) noexcept = default;
88 Row(Row &&) noexcept = default;
89 Row &operator=(const Row &) noexcept = default;
90
91 private:
92 Result result_;
93
94 protected:
95 friend class Field;
101 long index_{0};
102 Row::SizeType end_{0};
103 friend class Result;
104 Row(const Result &r, SizeType index) noexcept;
105};
106
107} // namespace orm
108} // namespace drogon
Definition RowIterator.h:116
Definition RowIterator.h:28
Reference to a field in a result set.
Definition Field.h:44
long index_
Definition Row.h:101
Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...
Definition Attribute.h:23