50#ifndef DOXYGEN_SHOULD_SKIP_THIS
61 template <
typename T_DATA >
63 GUM_CONSTRUCTOR(
DBRow);
67 template <
typename T_DATA >
69 row_(size, default_cell), weight_(weight) {
70 GUM_CONSTRUCTOR(DBRow);
74 template <
typename T_DATA >
75 DBRow< T_DATA >::DBRow(
const std::size_t size,
const double weight) :
76 DBRow(size, T_DATA(), weight) {}
79 template <
typename T_DATA >
80 DBRow< T_DATA >::DBRow(std::initializer_list< T_DATA > list,
const double weight) :
81 row_(list), weight_(weight) {
82 GUM_CONSTRUCTOR(DBRow);
86 template <
typename T_DATA >
87 void DBRow< T_DATA >::setRow(
const std::vector< T_DATA >& new_row) {
88 const std::size_t size = new_row.size();
91 std::copy(new_row.begin(), new_row.end(), row_.begin());
98 template <
typename T_DATA >
99 void DBRow< T_DATA >::setRow(std::vector< T_DATA >&& new_row) {
100 row_ = std::move(new_row);
104 template <
typename T_DATA >
105 DBRow< T_DATA >::DBRow(
const std::vector< T_DATA >& cells,
const double weight) :
108 GUM_CONSTRUCTOR(DBRow);
112 template <
typename T_DATA >
113 DBRow< T_DATA >::DBRow(std::vector< T_DATA >&& cells,
const double weight) :
114 row_(
std::move(cells)), weight_(weight) {
115 GUM_CONSTRUCTOR(DBRow);
119 template <
typename T_DATA >
120 DBRow< T_DATA >::DBRow(
const DBRow< T_DATA >& from) : row_(from.row_), weight_(from.weight_) {
125 template <
typename T_DATA >
126 DBRow< T_DATA >::DBRow(DBRow< T_DATA >&& from) :
127 row_(
std::move(from.row_)), weight_(from.weight_) {
132 template <
typename T_DATA >
133 DBRow< T_DATA >* DBRow< T_DATA >::clone()
const {
134 return new DBRow< T_DATA >(*
this);
138 template <
typename T_DATA >
139 DBRow< T_DATA >::~DBRow() {
140 GUM_DESTRUCTOR(DBRow);
144 template <
typename T_DATA >
145 DBRow< T_DATA >& DBRow< T_DATA >::operator=(
const DBRow< T_DATA >& from) {
148 weight_ = from.weight_;
154 template <
typename T_DATA >
155 DBRow< T_DATA >& DBRow< T_DATA >::operator=(DBRow< T_DATA >&& from) {
157 row_ = std::move(from.row_);
158 weight_ = from.weight_;
164 template <
typename T_DATA >
165 T_DATA& DBRow< T_DATA >::operator[](
const std::size_t i) {
170 template <
typename T_DATA >
171 const T_DATA& DBRow< T_DATA >::operator[](
const std::size_t i)
const {
176 template <
typename T_DATA >
177 const std::vector< T_DATA >& DBRow< T_DATA >::row() const noexcept {
182 template <
typename T_DATA >
183 std::vector< T_DATA >& DBRow< T_DATA >::row() noexcept {
188 template <
typename T_DATA >
189 const double& DBRow< T_DATA >::weight() const noexcept {
194 template <
typename T_DATA >
195 double& DBRow< T_DATA >::weight() noexcept {
200 template <
typename T_DATA >
201 void DBRow< T_DATA >::setWeight(
const double new_weight) {
202 weight_ = new_weight;
206 template <
typename T_DATA >
207 std::size_t DBRow< T_DATA >::size() const noexcept {
212 template <
typename T_DATA >
213 void DBRow< T_DATA >::resize(
const std::size_t new_size) {
214 row_.resize(new_size);
218 template <
typename T_DATA >
219 void DBRow< T_DATA >::reserve(
const std::size_t new_size) {
220 row_.reserve(new_size);
224 template <
typename T_DATA >
225 void DBRow< T_DATA >::pushBack(
const T_DATA& elt) {
230 template <
typename T_DATA >
231 void DBRow< T_DATA >::pushBack(T_DATA&& elt) {
232 row_.push_back(std::move(elt));
The class representing a record stored in a tabular database.
The class for storing a record in a database.
DBRow()
default constructor
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities