48#ifndef DOXYGEN_SHOULD_SKIP_THIS
59 template <
typename T_DATA >
61 GUM_CONSTRUCTOR(
DBRow);
65 template <
typename T_DATA >
67 const T_DATA default_cell,
68 const double weight) : row_(size, default_cell), weight_(weight) {
69 GUM_CONSTRUCTOR(DBRow);
73 template <
typename T_DATA >
74 INLINE DBRow< T_DATA >::DBRow(
const std::size_t size,
const double weight) :
75 DBRow(size, T_DATA(), weight) {}
78 template <
typename T_DATA >
79 INLINE DBRow< T_DATA >::DBRow(std::initializer_list< T_DATA > list,
const double weight) :
80 row_(list), weight_(weight) {
81 GUM_CONSTRUCTOR(DBRow);
85 template <
typename T_DATA >
86 INLINE
void DBRow< T_DATA >::setRow(
const std::vector< T_DATA >& new_row) {
87 const std::size_t size = new_row.size();
90 std::copy(new_row.begin(), new_row.end(), row_.begin());
97 template <
typename T_DATA >
98 INLINE
void DBRow< T_DATA >::setRow(std::vector< T_DATA >&& new_row) {
99 row_ = std::move(new_row);
103 template <
typename T_DATA >
104 INLINE DBRow< T_DATA >::DBRow(
const std::vector< T_DATA >& cells,
const double weight) :
107 GUM_CONSTRUCTOR(DBRow);
111 template <
typename T_DATA >
112 INLINE DBRow< T_DATA >::DBRow(std::vector< T_DATA >&& cells,
const double weight) :
113 row_(
std::move(cells)), weight_(weight) {
114 GUM_CONSTRUCTOR(DBRow);
118 template <
typename T_DATA >
119 INLINE DBRow< T_DATA >::DBRow(
const DBRow< T_DATA >& from) :
120 row_(from.row_), weight_(from.weight_) {
125 template <
typename T_DATA >
126 INLINE DBRow< T_DATA >::DBRow(DBRow< T_DATA >&& from) :
127 row_(
std::move(from.row_)), weight_(from.weight_) {
132 template <
typename T_DATA >
133 INLINE DBRow< T_DATA >* DBRow< T_DATA >::clone()
const {
134 return new DBRow< T_DATA >(*
this);
138 template <
typename T_DATA >
139 INLINE DBRow< T_DATA >::~DBRow() {
140 GUM_DESTRUCTOR(DBRow);
144 template <
typename T_DATA >
145 INLINE DBRow< T_DATA >& DBRow< T_DATA >::operator=(
const DBRow< T_DATA >& from) {
148 weight_ = from.weight_;
154 template <
typename T_DATA >
155 INLINE 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 INLINE T_DATA& DBRow< T_DATA >::operator[](
const std::size_t i) {
170 template <
typename T_DATA >
171 INLINE
const T_DATA& DBRow< T_DATA >::operator[](
const std::size_t i)
const {
176 template <
typename T_DATA >
177 INLINE
const std::vector< T_DATA >& DBRow< T_DATA >::row() const noexcept {
182 template <
typename T_DATA >
183 INLINE std::vector< T_DATA >& DBRow< T_DATA >::row() noexcept {
188 template <
typename T_DATA >
189 INLINE
const double& DBRow< T_DATA >::weight() const noexcept {
194 template <
typename T_DATA >
195 INLINE
double& DBRow< T_DATA >::weight() noexcept {
200 template <
typename T_DATA >
201 INLINE
void DBRow< T_DATA >::setWeight(
const double new_weight) {
202 weight_ = new_weight;
206 template <
typename T_DATA >
207 INLINE std::size_t DBRow< T_DATA >::size() const noexcept {
212 template <
typename T_DATA >
213 INLINE
void DBRow< T_DATA >::resize(
const std::size_t new_size) {
214 row_.resize(new_size);
218 template <
typename T_DATA >
219 INLINE
void DBRow< T_DATA >::reserve(
const std::size_t new_size) {
220 row_.reserve(new_size);
224 template <
typename T_DATA >
225 INLINE
void DBRow< T_DATA >::pushBack(
const T_DATA& elt) {
230 template <
typename T_DATA >
231 INLINE
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