chombo-discharge
CD_KMCSingleState.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2022 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_KMCSingleState_H
13 #define CD_KMCSingleState_H
14 
15 // Std includes
16 #include <vector>
17 
18 // Our includes
19 #include <CD_NamespaceHeader.H>
20 
26 template <typename T = long long>
28 {
29 public:
30  using State = std::vector<T>;
31 
35  inline KMCSingleState() = delete;
36 
41  inline KMCSingleState(const KMCSingleState& a_state) = default;
42 
46  inline KMCSingleState(KMCSingleState&&) = delete;
47 
52  inline KMCSingleState(const size_t a_numSpecies) noexcept;
53 
57  virtual ~KMCSingleState();
58 
62  inline KMCSingleState&
63  operator=(const KMCSingleState&) = default;
64 
68  inline KMCSingleState&
69  operator=(const KMCSingleState&&) = delete;
70 
75  inline T&
76  operator[](const size_t a_idx) noexcept;
77 
82  inline const T&
83  operator[](const size_t a_idx) const noexcept;
84 
89  inline bool
90  isValidState() const noexcept;
91 
96  inline State&
97  getState() noexcept;
98 
103  inline const State&
104  getState() const noexcept;
105 
106 protected:
110  State m_state;
111 };
112 
113 #include <CD_NamespaceFooter.H>
114 
115 #include <CD_KMCSingleStateImplem.H>
116 
117 #endif
Implementation of CD_KMCSingleState.H.
Declaration of a straightforward state for advancing with the Kinetic Monte Carlo module.
Definition: CD_KMCSingleState.H:28
KMCSingleState(const KMCSingleState &a_state)=default
Copy constructor.
KMCSingleState & operator=(const KMCSingleState &)=default
Copy assignment constructor.
T & operator[](const size_t a_idx) noexcept
Get the population of the input index.
Definition: CD_KMCSingleStateImplem.H:48
virtual ~KMCSingleState()
Destructor.
Definition: CD_KMCSingleStateImplem.H:26
KMCSingleState & operator=(const KMCSingleState &&)=delete
Disallowed move assignement.
KMCSingleState()=delete
Disallowed weak construction.
State m_state
State vector.
Definition: CD_KMCSingleState.H:110
KMCSingleState(KMCSingleState &&)=delete
Disallowed move constructor.
State & getState() noexcept
Get modifiable state.
Definition: CD_KMCSingleStateImplem.H:66
bool isValidState() const noexcept
Check if state is a valid state.
Definition: CD_KMCSingleStateImplem.H:31