C++ mpi module for stochmagnet_main Package
SM_StochasticOutput.h
1 #ifndef SM_StochasticOutput_H
2 #define SM_StochasticOutput_H
3 
4 //bas class header
5 #include "SM_StochasticOutputComponent.h"
6 
7 
23 template<class StochOutputImplement>
25 
26  // ATTRIBUTES
27 
28 private:
29 
31 
32 
33 protected:
34  // METHODS
35 
36  // CONSTRUCTORS
37 
41 
42  }
43 
44 
45 
46  // DESTRUCTORS
47 protected:
48 
51  virtual ~SM_StochasticOutput(void) {
52  }
53 
54 
55 
56 public:
57  //MEMORY
58 
72  virtual tMemSize getMemorySize() const {
73  return sizeof(*this)+getContentsMemorySize();
74  }
75 
84  virtual tMemSize getContentsMemorySize() const {
86  return mem;
87  }
88 
89 public:
90 
94  virtual void copy(const SM_StochasticOutputComponent& c) {
96  }
97 
98 
99 
100  //virtual methods
101  //================
105  virtual tBoolean openComponent(const SM_Beam& beam) final {
106  return this->open(beam);
107  };
108 
113  virtual tBoolean openComponent(const tIndex& s,const SM_System& system) final {
114  return this->open(s,system);
115  }
116 
117 
121  virtual tBoolean storeComponent(const SM_System& system) final {
122  return this->store(system);
123  }
124 
130  virtual tBoolean closeComponent(const tIndex& s,const SM_System& system,const tBoolean& hasSucceeded) final {
131  return this->close(s,system,hasSucceeded);
132  }
133 
137  virtual tBoolean closeComponent(const SM_Beam& beam) final {
138  return this->close(beam);
139  }
140 
141  //templated methods to specialized
142  //=================================
143 
147  inline tBoolean open(const SM_Beam& beam) {
148  return static_cast<StochOutputImplement*>(this)->open(beam);
149  }
150 
155  inline tBoolean open(const tIndex& s,const SM_System& system) {
156  return static_cast<StochOutputImplement*>(this)->open(s,system);
157  }
158 
159 
160 
164  inline tBoolean store(const SM_System& system) {
165  return static_cast<StochOutputImplement*>(this)->store(system);
166  }
172  inline tBoolean close(const tIndex& s,const SM_System& system,const tBoolean& hasSucceeded) {
173  return static_cast<StochOutputImplement*>(this)->close(s,system,hasSucceeded);
174  }
178  inline tBoolean close(const SM_Beam& beam) {
179  return static_cast<StochOutputImplement*>(this)->close(beam);
180  }
181 
182 
183 };
184 
185 #endif
This class defines a general stochastic beam of trajectories of system.
Definition: SM_Beam.h:61
This class stores stochastic outpus computed for each trajectory of a simulation of trajectories of a...
Definition: SM_StochasticOutputComponent.h:36
virtual void copy(const SM_StochasticOutputComponent &c)
copy
Definition: SM_StochasticOutputComponent.h:162
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_StochasticOutputComponent.h:144
this class implements the virtual methods of its base class SM_StochasticOutputComponent with templat...
Definition: SM_StochasticOutput.h:24
virtual tBoolean closeComponent(const SM_Beam &beam) final
close stochastic data at the end of all simulations
Definition: SM_StochasticOutput.h:137
virtual ~SM_StochasticOutput(void)
destroy
Definition: SM_StochasticOutput.h:51
tBoolean close(const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded)
close the stochastic data for the simulation s
Definition: SM_StochasticOutput.h:172
virtual tBoolean openComponent(const SM_Beam &beam) final
open the stochastic data
Definition: SM_StochasticOutput.h:105
virtual tBoolean storeComponent(const SM_System &system) final
store the stochastic data during the relation method of the system
Definition: SM_StochasticOutput.h:121
tBoolean close(const SM_Beam &beam)
close stochastic data at the end of all simulations
Definition: SM_StochasticOutput.h:178
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_StochasticOutput.h:84
tBoolean open(const tIndex &s, const SM_System &system)
open the stochastic data for simulation s
Definition: SM_StochasticOutput.h:155
virtual tBoolean openComponent(const tIndex &s, const SM_System &system) final
open the stochastic data for simulation s
Definition: SM_StochasticOutput.h:113
tBoolean store(const SM_System &system)
store the stochastic data during the relation method of the system
Definition: SM_StochasticOutput.h:164
virtual void copy(const SM_StochasticOutputComponent &c)
copy
Definition: SM_StochasticOutput.h:94
virtual tBoolean closeComponent(const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded) final
close the stochastic data for the simulation s
Definition: SM_StochasticOutput.h:130
SM_StochasticOutput(void)
create
Definition: SM_StochasticOutput.h:40
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_StochasticOutput.h:72
tBoolean open(const SM_Beam &beam)
open the stochastic data
Definition: SM_StochasticOutput.h:147
This class is a one simulation of a beam for Stoch Magnet package.
Definition: SM_System.h:53