aGrUM  0.14.2
DBRowGeneratorIdentity.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  ***************************************************************************/
25 #ifndef GUM_LEARNING_DBROW_GENERATOR_IDENTITY_H
26 #define GUM_LEARNING_DBROW_GENERATOR_IDENTITY_H
27 
28 #include <agrum/agrum.h>
30 
31 namespace gum {
32 
33  namespace learning {
34 
72  template < template < typename > class ALLOC = std::allocator >
73  class DBRowGeneratorIdentity : public DBRowGenerator< ALLOC > {
74  public:
76  using allocator_type = ALLOC< DBTranslatedValue >;
77 
78  // ##########################################################################
80  // ##########################################################################
81 
83 
86  const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > >
87  column_types,
88  const allocator_type& alloc = allocator_type());
89 
92 
95  const allocator_type& alloc);
96 
99 
102  const allocator_type& alloc);
103 
105  virtual DBRowGeneratorIdentity< ALLOC >* clone() const override final;
106 
108  virtual DBRowGeneratorIdentity< ALLOC >*
109  clone(const allocator_type& alloc) const override final;
110 
113 
115 
116 
117  // ##########################################################################
119  // ##########################################################################
120 
122 
124  DBRowGeneratorIdentity< ALLOC >&
125  operator=(const DBRowGeneratorIdentity< ALLOC >& from);
126 
128  DBRowGeneratorIdentity< ALLOC >&
129  operator=(DBRowGeneratorIdentity< ALLOC >&& from);
130 
132 
133 
134  // ##########################################################################
136  // ##########################################################################
137 
139 
141  virtual const DBRow< DBTranslatedValue, ALLOC >& generate() final;
142 
145 
147 
148 
149  protected:
151  virtual std::size_t
152  _computeRows(const DBRow< DBTranslatedValue, ALLOC >& row) final;
153 
154 
155 #ifndef DOXYGEN_SHOULD_SKIP_THIS
156 
157  private:
159  const DBRow< DBTranslatedValue, ALLOC >* __input_row{nullptr};
160 
161 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
162  };
163 
164  } /* namespace learning */
165 
166 } /* namespace gum */
167 
168 
169 // always include the template implementation
171 
172 #endif /* GUM_LEARNING_DBROW_GENERATOR_IDENTITY_H */
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods
The base class for all DBRow generators.
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
virtual DBRowGeneratorIdentity< ALLOC > * clone() const override final
virtual copy constructor
STL namespace.
A filtered row generator that returns exactly the rows it gets in input.
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
DBTranslatedValueType
The nature of the elements handled by translators (discrete, continuous).
A DBRowGenerator class that returns exactly the rows it gets in input.
The class for storing a record in a database.
Definition: DBRow.h:53
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.
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods