OpenMS
ModelDescription.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 
14 #include <sstream>
15 
16 namespace OpenMS
17 {
25  template <UInt D>
27  {
28 public:
29 
32  name_(),
33  parameters_()
34  {
35  }
36 
39  name_(source.name_),
40  parameters_(source.parameters_)
41  {
42  }
43 
45  ModelDescription(const BaseModel * model) :
46  name_(model->getName()),
47  parameters_(model->getParameters())
48  {
49  }
50 
53  {
54  }
55 
57  virtual ModelDescription & operator=(const ModelDescription & source)
58  {
59  if (&source == this) return *this;
60 
61  name_ = source.name_;
62  parameters_ = source.parameters_;
63 
64  return *this;
65  }
66 
70  const String & getName() const
71  {
72  return name_;
73  }
74 
77  {
78  return name_;
79  }
80 
82  void setName(const String & name)
83  {
84  name_ = name;
85  }
86 
88  const Param & getParam() const
89  {
90  return parameters_;
91  }
92 
95  {
96  return parameters_;
97  }
98 
100  void setParam(const Param & param)
101  {
102  parameters_ = param;
103  }
104 
107  virtual bool operator==(const ModelDescription & rhs) const
108  {
109  return (name_ == rhs.name_) && (parameters_ == rhs.parameters_);
110  }
111 
112  virtual bool operator!=(const ModelDescription & rhs) const
113  {
114  return !(operator==(rhs));
115  }
116 
118 
119 protected:
120 
123  };
124 }
Abstract base class for 1-dimensional models.
Definition: BaseModel.h:22
Stores the name and parameters of a model.
Definition: ModelDescription.h:27
void setParam(const Param &param)
Set the model parameters.
Definition: ModelDescription.h:100
Param & getParam()
Mutable access to the model parameters.
Definition: ModelDescription.h:94
const Param & getParam() const
Non-mutable access to model parameters.
Definition: ModelDescription.h:88
String name_
Definition: ModelDescription.h:121
virtual bool operator==(const ModelDescription &rhs) const
Definition: ModelDescription.h:107
void setName(const String &name)
Set the model name.
Definition: ModelDescription.h:82
ModelDescription(const BaseModel *model)
constructor provided for convenience
Definition: ModelDescription.h:45
virtual ~ModelDescription()
destructor
Definition: ModelDescription.h:52
virtual bool operator!=(const ModelDescription &rhs) const
Definition: ModelDescription.h:112
ModelDescription()
Default constructor.
Definition: ModelDescription.h:31
virtual ModelDescription & operator=(const ModelDescription &source)
assignment operator
Definition: ModelDescription.h:57
const String & getName() const
Non-mutable access to model name.
Definition: ModelDescription.h:70
Param parameters_
Definition: ModelDescription.h:122
ModelDescription(const ModelDescription &source)
copy constructor
Definition: ModelDescription.h:38
String & getName()
Mutable access to the model name.
Definition: ModelDescription.h:76
Management and storage of parameters / INI files.
Definition: Param.h:44
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19