Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkModelFitStaticParameterMap.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkModelFitStaticParameterMap_h
14 #define mitkModelFitStaticParameterMap_h
15 
16 #include <vector>
17 #include <string>
18 #include <map>
19 
20 #include "MitkModelFitExports.h"
21 #include "mitkModelBase.h"
22 
23 namespace mitk
24 {
25  namespace modelFit
26  {
29  {
30  private:
32  typedef ModelBase::ParameterNameType KeyType;
33 
34  public:
38  typedef std::pair<KeyType, ValueType> StaticParameterType;
39 
40  private:
42  typedef ModelBase::StaticParameterMapType MapType;
43 
44  /* @brief Stores the variables with their value lists */
45  MapType m_map;
46 
51  unsigned int m_numValues;
52 
53  public:
55  typedef MapType::const_iterator const_iterator;
56 
57  StaticParameterMap() : m_numValues(1) {}
58 
74  void Add(const std::string& name, const ValueType& newList);
75 
82  const ValueType& Get(const std::string& name) const;
83 
84  MapType::size_type Size() const
85  {
86  return m_map.size();
87  }
88 
89  const_iterator begin() const
90  {
91  return m_map.begin();
92  }
93 
94  const_iterator end() const
95  {
96  return m_map.end();
97  }
98 
124  void Sort(const std::string& name = "");
125 
129  void Clear();
130  };
131 
140  {
141  return (a.front() < b.front());
142  }
143  }
144 }
145 
146 #endif // mitkModelFitStaticParameterMap_h
std::map< ParameterNameType, StaticParameterValuesType > StaticParameterMapType
Definition: mitkModelBase.h:72
std::pair< KeyType, ValueType > StaticParameterType
Type of a variable, consisting of name and value list.
ModelBase::StaticParameterValuesType ValueType
Type of the map value.
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list&#39;s first item is lower than the second one&#39;s...
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKMODELFIT_EXPORT
std::vector< StaticParameterValueType > StaticParameterValuesType
Definition: mitkModelBase.h:71
ModelTraitsInterface::ParameterNameType ParameterNameType
Definition: mitkModelBase.h:63
MapType::const_iterator const_iterator
Needed for &#39;foreach&#39; support.