BAT  0.9.4
The Bayesian analysis toolkit
 All Classes Namespaces Functions Variables Enumerations
BCParameterSet.h
1 #ifndef __BCPARAMETERSET__H
2 #define __BCPARAMETERSET__H
3 
11 /*
12  * Copyright (C) 2007-2014, the BAT core developer team
13  * All rights reserved.
14  *
15  * For the licensing terms see doc/COPYING.
16  * For documentation see http://mpp.mpg.de/bat
17  */
18 
19 // ---------------------------------------------------------
20 
21 #include <vector>
22 #include <string>
23 
24 class BCParameter;
25 
26 // ---------------------------------------------------------
27 
29 {
30 public:
37  bool Add(BCParameter * par);
38 
39  void Clear(bool);
40 
47  BCParameter * operator[](unsigned index) const
48  {
49  return fPars[index];
50  }
51 
58  BCParameter * Get(unsigned index) const
59  {
60  return ValidIndex(index, "Get") ? fPars[index] : NULL;
61  }
62 
69  BCParameter * Get(const std::string & name) const
70  {
71  return Get(Index(name));
72  }
73 
77  unsigned Index(const std::string & name) const;
78 
82  unsigned Size() const
83  { return fPars.size(); }
84 
91  bool ValidIndex(unsigned index, const std::string caller="CheckIndex") const;
92 
93 private:
95  std::vector<BCParameter*> fPars;
96 };
97 #endif
BCParameter * Get(const std::string &name) const
BCParameter * operator[](unsigned index) const
bool Add(BCParameter *par)
bool ValidIndex(unsigned index, const std::string caller="CheckIndex") const
A class representing a parameter of a model.
Definition: BCParameter.h:28
unsigned Size() const
unsigned Index(const std::string &name) const
BCParameter * Get(unsigned index) const