Warning, file /include/Geant4/G4AccValue.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef G4AccValue_h
0032 #define G4AccValue_h 1
0033
0034 #include "G4VAccumulable.hh"
0035 #include "G4MergeMode.hh"
0036
0037 #include "globals.hh"
0038
0039 template <typename T>
0040 class G4AccValue : public G4VAccumulable
0041 {
0042 public:
0043 G4AccValue(const G4String& name, T initValue,
0044 G4MergeMode mergeMode = G4MergeMode::kAddition);
0045 G4AccValue(T initValue = 0,
0046 G4MergeMode mergeMode = G4MergeMode::kAddition);
0047 G4AccValue(const G4AccValue& rhs);
0048 G4AccValue(G4AccValue&& rhs) noexcept;
0049 ~G4AccValue() override = default;
0050
0051
0052 G4AccValue<T>& operator= (const G4AccValue<T>& rhs);
0053 G4AccValue<T>& operator=(G4AccValue<T>&& rhs) noexcept;
0054 G4AccValue<T>& operator+=(const G4AccValue<T>& rhs);
0055 G4AccValue<T>& operator*=(const G4AccValue<T>& rhs);
0056 G4AccValue<T> operator++(int);
0057 G4AccValue<T>& operator++();
0058
0059 G4AccValue<T>& operator= (const T& rhs);
0060 G4AccValue<T>& operator+=(const T& rhs);
0061 G4AccValue<T>& operator*=(const T& rhs);
0062
0063
0064 void Merge(const G4VAccumulable& other) final;
0065 void Reset() final;
0066 using G4VAccumulable::Print;
0067 void Print(G4PrintOptions options = G4PrintOptions()) const final;
0068
0069
0070 void SetMergeMode(G4MergeMode value) final;
0071
0072 G4AccType GetType() const final { return G4AccType::kValue; }
0073
0074
0075 T GetValue() const;
0076
0077 private:
0078
0079 T fValue = 0;
0080 T fInitValue = 0;
0081 G4MergeFunction<T> fMergeFunction;
0082 };
0083
0084
0085
0086 #include "G4AccValue.icc"
0087
0088 #endif