aGrUM  0.14.2
DBRowGenerator4CompleteRows.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef GUM_LEARNING_DBROW_GENERATOR_4_COMPLETE_ROWS_H
27 #define GUM_LEARNING_DBROW_GENERATOR_4_COMPLETE_ROWS_H
28 
29 #include <agrum/agrum.h>
31 
32 namespace gum {
33 
34  namespace learning {
35 
76  template < template < typename > class ALLOC = std::allocator >
77  class DBRowGenerator4CompleteRows : public DBRowGenerator< ALLOC > {
78  public:
80  using allocator_type = ALLOC< DBTranslatedValue >;
81 
82  // ##########################################################################
84  // ##########################################################################
85 
87 
90  const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > >
91  column_types,
92  const allocator_type& alloc = allocator_type());
93 
97 
100  const allocator_type& alloc);
101 
104 
107  const allocator_type& alloc);
108 
110  virtual DBRowGenerator4CompleteRows< ALLOC >* clone() const override final;
111 
113  virtual DBRowGenerator4CompleteRows< ALLOC >*
114  clone(const allocator_type& alloc) const override final;
115 
118 
120 
121 
122  // ##########################################################################
124  // ##########################################################################
125 
127 
130  operator=(const DBRowGenerator4CompleteRows< ALLOC >& from);
131 
134  operator=(DBRowGenerator4CompleteRows< ALLOC >&& from);
135 
137 
138 
139  // ##########################################################################
141  // ##########################################################################
142 
144 
146 
149  virtual const DBRow< DBTranslatedValue, ALLOC >& generate() final;
150 
153 
155 
156 
157  protected:
159  virtual std::size_t
160  _computeRows(const DBRow< DBTranslatedValue, ALLOC >& row) final;
161 
162 
163 #ifndef DOXYGEN_SHOULD_SKIP_THIS
164 
165  private:
167  const DBRow< DBTranslatedValue, ALLOC >* __input_row{nullptr};
168 
169 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
170  };
171 
172  } /* namespace learning */
173 
174 } /* namespace gum */
175 
176 
177 // always include the template implementation
179 
180 #endif /* GUM_LEARNING_DBROW_GENERATOR_4_COMPLETE_ROWS_H */
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods
The base class for all DBRow generators.
A DBRowGenerator class that returns the rows that are complete (fully observed) w.r.t.
STL namespace.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
The union class for storing the translated values in learning databases.
virtual std::size_t _computeRows(const DBRow< DBTranslatedValue, ALLOC > &row) final
computes the rows it will provide as output
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods
DBTranslatedValueType
The nature of the elements handled by translators (discrete, continuous).
allocator_type getAllocator() const
returns the allocator used
The class for storing a record in a database.
Definition: DBRow.h:53
DBRowGenerator4CompleteRows(const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > > column_types, const allocator_type &alloc=allocator_type())
default constructor
A DBRowGenerator class that returns the rows that are complete (fully observed) w.r.t.
virtual const DBRow< DBTranslatedValue, ALLOC > & generate() final
generates one ouput DBRow for each DBRow passed to method setInputRow
The base class for all DBRow generators.
virtual DBRowGenerator4CompleteRows< ALLOC > * clone() const override final
virtual copy constructor