YAP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StaticDataAccessor.h
Go to the documentation of this file.
1 /* YAP - Yet another PWA toolkit
2  Copyright 2015, Technische Universitaet Muenchen,
3  Authors: Daniel Greenwald, Johannes Rauch
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
20 
21 #ifndef yap_StaticDataAccessor_h
22 #define yap_StaticDataAccessor_h
23 
24 #include "fwd/Model.h"
25 #include "fwd/ParticleCombination.h"
26 #include "fwd/StaticDataAccessor.h"
27 #include "fwd/StatusManager.h"
28 
29 #include "DataAccessor.h"
30 
31 namespace yap {
32 
37 {
38 public:
39 
43  StaticDataAccessor(Model& m, const ParticleCombinationEqualTo& equal)
44  : DataAccessor(equal), Model_(&m) {}
45 
48  virtual void calculate(DataPoint& d, StatusManager& sm) const = 0;
49 
51  const Model* model() const override
52  { return Model_; }
53 
54 protected:
55 
57  void virtual registerWithModel() override;
58 
60  void virtual addToStaticDataAccessors();
61 
63  StaticDataAccessorVector& staticDataAccessors();
64 
65 private:
66 
67  Model* Model_;
68 
69 };
70 
72 void remove_expired(StaticDataAccessorVector& S);
73 
74 }
75 
76 #endif
StaticDataAccessorVector & staticDataAccessors()
access to the model's StaticDataAccessors_
Definition: StaticDataAccessor.cxx:8
const ParticleCombinationEqualTo & equal() const
Definition: DataAccessor.h:47
virtual void registerWithModel() override
register with Model
Definition: StaticDataAccessor.cxx:16
Class for holding data and cached values per data point for fast calculation.
Definition: DataPoint.h:35
virtual void calculate(DataPoint &d, StatusManager &sm) const =0
StaticDataAccessor(Model &m, const ParticleCombinationEqualTo &equal)
Definition: StaticDataAccessor.h:43
Base class for all data accessors that will only write to DataPoint once at initial data loading...
Definition: StaticDataAccessor.h:36
Definition: StatusManager.h:32
Class implementing a PWA model.
Definition: Model.h:56
void remove_expired(DataAccessorSet &S)
remove expired elements of set
Definition: DataAccessor.cxx:180
Abstract base class for all objects accessing DataPoint's.
Definition: DataAccessor.h:38
virtual void addToStaticDataAccessors()
add to model's StaticDataAccessors_
Definition: StaticDataAccessor.cxx:27
const Model * model() const override
Definition: StaticDataAccessor.h:51