aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
approximationSchemeListener.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /**
23  * @file
24  * @brief gum::ApproximationSchemeListener header file.
25  *
26  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
27  */
28 
29 #ifndef APPROXIMATIONSCHEMELISTENER_H
30 #define APPROXIMATIONSCHEMELISTENER_H
31 
32 #include <agrum/agrum.h>
33 #include <agrum/tools/core/signal/listener.h>
34 
35 #include <agrum/tools/core/approximations/IApproximationSchemeConfiguration.h>
36 
37 namespace gum {
38 
39  /**
40  * @class ApproximationSchemeListener
41  * @brief The ApproximationSchemeListener class.
42  *
43  * @warning Doxygen does not like spanning command on multiple line, so we
44  * could not configure it with the correct include directive. Use the
45  * following code snippet to include this file.
46  * @code
47  * #include <agrum/tools/core/approximations/approximationSchemeListener.h>
48  * @endcode
49  */
51  public:
52  /**
53  * @brief Class constructor.
54  * @param sch The scheme configuration.
55  */
56  ApproximationSchemeListener(IApproximationSchemeConfiguration& sch);
57 
58  /**
59  * @brief Class destructor.
60  */
61  virtual ~ApproximationSchemeListener();
62 
63  /**
64  * @brief When progress was made.
65  * @param src The signal source.
66  * @param pourcent The advancement in percent.
67  * @param error The number of errors.
68  * @param time The time.
69  */
70  virtual void
71  whenProgress(const void* src, const Size step, const double error, const double time)
72  = 0;
73 
74  /**
75  * @brief When it stops.
76  * @param src The signal source.
77  * @param message A message.
78  */
79  virtual void whenStop(const void* src, const std::string message) = 0;
80 
81  protected:
82  /**
83  * Copy constructor.
84  */
86 
87  /**
88  * Copy operator.
89  */
91 
92  private:
93  /// The scheme configuration.
95  };
96 } // namespace gum
97 
98 #endif // APPROXIMATIONSCHEMELISTENER_H
ApproximationSchemeListener(const ApproximationSchemeListener &other)
Copy constructor.
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
virtual void whenStop(const void *src, const std::string message)=0
When it stops.
virtual ~ApproximationSchemeListener()
Class destructor.
ApproximationSchemeListener(IApproximationSchemeConfiguration &sch)
Class constructor.
IApproximationSchemeConfiguration & _sch_
The scheme configuration.
virtual void whenProgress(const void *src, const Size step, const double error, const double time)=0
When progress was made.
ApproximationSchemeListener & operator=(const ApproximationSchemeListener &other)
Copy operator.
The ApproximationSchemeListener class.