bpp-core3  3.0.0
AutoParameter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_NUMERIC_AUTOPARAMETER_H
6 #define BPP_NUMERIC_AUTOPARAMETER_H
7 
8 
9 #include "Parameter.h"
10 
11 // From Utils:
12 #include "../Io/OutputStream.h"
13 
14 namespace bpp
15 {
24  public Parameter
25 {
26 private:
27  std::shared_ptr<OutputStream> messageHandler_;
28 
29 public:
38  AutoParameter(const std::string& name = "", double value = 0, std::shared_ptr<ConstraintInterface> constraint = nullptr);
39 
45  AutoParameter(const Parameter& param);
46 
52  AutoParameter(const AutoParameter& param);
53 
59  AutoParameter& operator=(const AutoParameter& param);
60 
61  virtual ~AutoParameter() {}
62 
63  AutoParameter* clone() const { return new AutoParameter(*this); }
64 
65 public:
79  virtual void setValue(double value);
80 
81 public:
82  // Specific method:
83 
95  virtual void setMessageHandler(std::shared_ptr<OutputStream> mh) { messageHandler_ = mh; }
96 
97 public:
98  static std::string CONSTRAINTS_AUTO;
99  static std::string CONSTRAINTS_IGNORE;
100  static std::string CONSTRAINTS_KEEP;
101 };
102 } // end of namespace bpp.
103 #endif // BPP_NUMERIC_AUTOPARAMETER_H
static std::string CONSTRAINTS_IGNORE
Definition: AutoParameter.h:99
static std::string CONSTRAINTS_KEEP
AutoParameter & operator=(const AutoParameter &param)
Assignment operator.
This class is designed to facilitate the manipulation of parameters.
Definition: Parameter.h:97
virtual void setMessageHandler(std::shared_ptr< OutputStream > mh)
Set the message handler for this AutoParameter.
Definition: AutoParameter.h:95
std::shared_ptr< OutputStream > messageHandler_
Definition: AutoParameter.h:27
The AutoParameter class.
Definition: AutoParameter.h:23
virtual ~AutoParameter()
Definition: AutoParameter.h:61
static std::string CONSTRAINTS_AUTO
Definition: AutoParameter.h:98
AutoParameter(const std::string &name="", double value=0, std::shared_ptr< ConstraintInterface > constraint=nullptr)
Build a new AutoParameter.
AutoParameter * clone() const
Create a copy of this object and send a pointer to it.
Definition: AutoParameter.h:63
virtual const ConstraintInterface & constraint() const
Return the constraint associated to this parameter if there is one.
Definition: Parameter.h:203
virtual void setValue(double value)
Set the value of this parameter.