28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 38 template <
typename T_DATA,
template <
typename >
class ALLOC >
40 return _row.get_allocator();
45 template <
typename T_DATA,
template <
typename >
class ALLOC >
48 GUM_CONSTRUCTOR(
DBRow);
53 template <
typename T_DATA,
template <
typename >
class ALLOC >
58 template <
typename T_DATA,
template <
typename >
class ALLOC >
60 const T_DATA default_cell,
62 const ALLOC< T_DATA >& alloc) :
63 _row(size, default_cell, alloc),
65 GUM_CONSTRUCTOR(
DBRow);
70 template <
typename T_DATA,
template <
typename >
class ALLOC >
73 const ALLOC< T_DATA >& alloc) :
74 DBRow(size, T_DATA(), weight, alloc) {}
77 template <
typename T_DATA,
template <
typename >
class ALLOC >
80 const ALLOC< T_DATA >& alloc) :
83 GUM_CONSTRUCTOR(
DBRow);
88 template <
typename T_DATA,
template <
typename >
class ALLOC >
89 template <
template <
typename >
class OTHER_ALLOC >
91 const std::vector< T_DATA, OTHER_ALLOC< T_DATA > >& new_row) {
92 const std::size_t
size = new_row.size();
95 std::copy(new_row.begin(), new_row.end(),
_row.begin());
103 template <
typename T_DATA,
template <
typename >
class ALLOC >
105 std::vector< T_DATA, ALLOC< T_DATA > >&& new_row) {
106 _row = std::move(new_row);
111 template <
typename T_DATA,
template <
typename >
class ALLOC >
112 template <
template <
typename >
class OTHER_ALLOC >
114 const std::vector< T_DATA, OTHER_ALLOC< T_DATA > >& cells,
116 const ALLOC< T_DATA >& alloc) :
120 GUM_CONSTRUCTOR(
DBRow);
125 template <
typename T_DATA,
template <
typename >
class ALLOC >
127 std::vector< T_DATA, ALLOC< T_DATA > >&& cells,
129 const ALLOC< T_DATA >& alloc) :
132 GUM_CONSTRUCTOR(
DBRow);
137 template <
typename T_DATA,
template <
typename >
class ALLOC >
139 const ALLOC< T_DATA >& alloc) :
147 template <
typename T_DATA,
template <
typename >
class ALLOC >
153 template <
typename T_DATA,
template <
typename >
class ALLOC >
155 const ALLOC< T_DATA >& alloc) :
163 template <
typename T_DATA,
template <
typename >
class ALLOC >
169 template <
typename T_DATA,
template <
typename >
class ALLOC >
170 DBRow< T_DATA, ALLOC >*
172 ALLOC< DBRow< T_DATA, ALLOC > > allocator(alloc);
173 DBRow< T_DATA, ALLOC >*
row = allocator.allocate(1);
175 allocator.construct(row, *
this, alloc);
177 allocator.deallocate(row, 1);
185 template <
typename T_DATA,
template <
typename >
class ALLOC >
192 template <
typename T_DATA,
template <
typename >
class ALLOC >
194 GUM_DESTRUCTOR(
DBRow);
199 template <
typename T_DATA,
template <
typename >
class ALLOC >
201 operator=(
const DBRow< T_DATA, ALLOC >& from) {
211 template <
typename T_DATA,
template <
typename >
class ALLOC >
213 operator=(DBRow< T_DATA, ALLOC >&& from) {
215 _row = std::move(from._row);
222 template <
typename T_DATA,
template <
typename >
class ALLOC >
228 template <
typename T_DATA,
template <
typename >
class ALLOC >
235 template <
typename T_DATA,
template <
typename >
class ALLOC >
236 INLINE
const std::vector< T_DATA, ALLOC< T_DATA > >&
242 template <
typename T_DATA,
template <
typename >
class ALLOC >
243 INLINE std::vector< T_DATA, ALLOC< T_DATA > >&
249 template <
typename T_DATA,
template <
typename >
class ALLOC >
255 template <
typename T_DATA,
template <
typename >
class ALLOC >
261 template <
typename T_DATA,
template <
typename >
class ALLOC >
267 template <
typename T_DATA,
template <
typename >
class ALLOC >
273 template <
typename T_DATA,
template <
typename >
class ALLOC >
275 _row.resize(new_size);
279 template <
typename T_DATA,
template <
typename >
class ALLOC >
281 _row.reserve(new_size);
285 template <
typename T_DATA,
template <
typename >
class ALLOC >
291 template <
typename T_DATA,
template <
typename >
class ALLOC >
293 _row.push_back(std::move(elt));
DBRow< T_DATA, ALLOC > * clone() const
virtual copy constructor
double _weight
the weight of the row
DBRow()
default constructor
DBRow< T_DATA, ALLOC > & operator=(const DBRow< T_DATA, ALLOC > &from)
copy operator
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::vector< T_DATA, ALLOC< T_DATA > > _row
the row itself
void setRow(const std::vector< T_DATA, OTHER_ALLOC< T_DATA > > &new_row)
sets a new row (without changing the weight)
void setWeight(const double new_weight)
sets a new weight
const std::vector< T_DATA, ALLOC< T_DATA > > & row() const noexcept
returns the current row (without the weight)
const double & weight() const noexcept
returns the weight assigned to the DBRow
void resize(const std::size_t new_size)
resize a given row, i.e., its number of elements
std::size_t size() const noexcept
returns the number of elements in the row
T_DATA & operator[](const std::size_t i)
returns the ith content of the row
void reserve(const std::size_t new_size)
reserve a size for the elements of a given row
ALLOC< T_DATA > getAllocator() const
returns the allocator used by the DBRow
void pushBack(const T_DATA &elt)
adds a new element at the end of the row