aGrUM  0.16.0
DBRowGeneratorIdentity_tpl.h
Go to the documentation of this file.
1 
30 
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 
33 namespace gum {
34 
35  namespace learning {
36 
38  template < template < typename > class ALLOC >
42  }
43 
44 
46  template < template < typename > class ALLOC >
48  const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > >
49  column_types,
51  DBRowGenerator< ALLOC >(
52  column_types,
54  alloc) {
55  GUM_CONSTRUCTOR(DBRowGeneratorIdentity);
56  }
57 
58 
60  template < template < typename > class ALLOC >
62  const DBRowGeneratorIdentity< ALLOC >& from,
64  DBRowGenerator< ALLOC >(from, alloc),
65  __input_row(from.__input_row) {
66  GUM_CONS_CPY(DBRowGeneratorIdentity);
67  }
68 
69 
71  template < template < typename > class ALLOC >
73  const DBRowGeneratorIdentity< ALLOC >& from) :
74  DBRowGeneratorIdentity< ALLOC >(from, from.getAllocator()) {}
75 
76 
78  template < template < typename > class ALLOC >
80  DBRowGeneratorIdentity< ALLOC >&& from,
82  DBRowGenerator< ALLOC >(std::move(from), alloc),
83  __input_row(from.__input_row) {
84  GUM_CONS_MOV(DBRowGeneratorIdentity);
85  }
86 
87 
89  template < template < typename > class ALLOC >
91  DBRowGeneratorIdentity< ALLOC >&& from) :
92  DBRowGeneratorIdentity< ALLOC >(std::move(from), from.getAllocator()) {}
93 
94 
96  template < template < typename > class ALLOC >
97  DBRowGeneratorIdentity< ALLOC >* DBRowGeneratorIdentity< ALLOC >::clone(
99  const {
100  ALLOC< DBRowGeneratorIdentity< ALLOC > > allocator(alloc);
101  DBRowGeneratorIdentity< ALLOC >* generator = allocator.allocate(1);
102  try {
103  allocator.construct(generator, *this, alloc);
104  } catch (...) {
105  allocator.deallocate(generator, 1);
106  throw;
107  }
108  return generator;
109  }
110 
111 
113  template < template < typename > class ALLOC >
114  DBRowGeneratorIdentity< ALLOC >*
116  return clone(this->getAllocator());
117  }
118 
119 
121  template < template < typename > class ALLOC >
123  GUM_DESTRUCTOR(DBRowGeneratorIdentity);
124  }
125 
126 
128  template < template < typename > class ALLOC >
129  DBRowGeneratorIdentity< ALLOC >& DBRowGeneratorIdentity< ALLOC >::
130  operator=(const DBRowGeneratorIdentity< ALLOC >& from) {
132  __input_row = from.__input_row;
133  return *this;
134  }
135 
136 
138  template < template < typename > class ALLOC >
139  DBRowGeneratorIdentity< ALLOC >& DBRowGeneratorIdentity< ALLOC >::
140  operator=(DBRowGeneratorIdentity< ALLOC >&& from) {
141  DBRowGenerator< ALLOC >::operator=(std::move(from));
142  __input_row = from.__input_row;
143  return *this;
144  }
145 
146 
148  template < template < typename > class ALLOC >
149  INLINE const DBRow< DBTranslatedValue, ALLOC >&
151  this->decreaseRemainingRows();
152  return *__input_row;
153  }
154 
155 
157  template < template < typename > class ALLOC >
159  const DBRow< DBTranslatedValue, ALLOC >& row) {
160  __input_row = &row;
161  return std::size_t(1);
162  }
163 
164 
165  } /* namespace learning */
166 
167 } /* namespace gum */
168 
169 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
DBRowGeneratorGoal
the type of things that a DBRowGenerator is designed for
DBRowGenerator< ALLOC > & operator=(const DBRowGenerator< ALLOC > &)
copy constructor
allocator_type getAllocator() const
returns the allocator used
DBRowGeneratorIdentity(const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > > column_types, const allocator_type &alloc=allocator_type())
default constructor
void decreaseRemainingRows()
decrease the number of remaining output rows
virtual DBRowGeneratorIdentity< ALLOC > * clone() const override final
virtual copy constructor
STL namespace.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
DBRowGeneratorIdentity< ALLOC > & operator=(const DBRowGeneratorIdentity< ALLOC > &from)
copy operator
virtual std::size_t _computeRows(const DBRow< DBTranslatedValue, ALLOC > &row) final
computes the rows it will provide as output
DBTranslatedValueType
The nature of the elements handled by translators (discrete, continuous).
allocator_type getAllocator() const
returns the allocator used
DBRowGenerator(const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > > column_types, const DBRowGeneratorGoal goal, const allocator_type &alloc=allocator_type())
default constructor
virtual const DBRow< DBTranslatedValue, ALLOC > & generate() final
generates one ouput DBRow for each DBRow passed to method setInputRow
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods