WRApplication
External kratos "application" for multiscale time integration.
CheckpointID.hpp
Go to the documentation of this file.
1 
3 #pragma once
4 
5 // --- Core Includes ---
6 #include "includes/key_hash.h"
7 
8 // --- STL Includes ---
9 #include <ostream>
10 
11 
12 namespace Kratos::WRApp {
13 
14 
19 
20 
23 {
24 public:
26  CheckpointID() noexcept;
27 
30  CheckpointID(int step, int path) noexcept;
31 
32  CheckpointID(CheckpointID&&) noexcept = default;
33 
34  CheckpointID(const CheckpointID&) noexcept = default;
35 
37  int GetStep() const noexcept;
38 
40  int GetAnalysisPath() const noexcept;
41 
43  friend bool operator==(CheckpointID left, CheckpointID right) noexcept;
44 
46  friend bool operator!=(CheckpointID left, CheckpointID right) noexcept;
47 
49  friend bool operator<(CheckpointID left, CheckpointID right) noexcept;
50 
51  friend std::ostream& operator<<(std::ostream& rStream, CheckpointID ID);
52 
53 private:
55  int mStep;
56 
58  int mPath;
59 }; // class
60 
61 
64 
65 
66 } // namespace Kratos::WRApp
67 
68 namespace std {
69 template <>
70 struct hash<Kratos::WRApp::CheckpointID>
71 {
73  {
74  auto output = hash<int>()(id.GetStep());
75  Kratos::HashCombine(output, id.GetAnalysisPath());
76  return output;
77  }
78 }; // struct hash
79 } // namespace std
80 
81 #include "wrapp/utils/impl/CheckpointID_impl.hpp"
Class enapsulating data and functionality for uniquely identifying a Checkpoint or Snapshot.
Definition: CheckpointID.hpp:23
CheckpointID() noexcept
Default constructor initialized to null.
int GetAnalysisPath() const noexcept
int GetStep() const noexcept
Definition: MPIUtils.hpp:9
Definition: AddIOToPython.hpp:12
Definition: CheckpointID.hpp:68
std::size_t operator()(Kratos::WRApp::CheckpointID id)
Definition: CheckpointID.hpp:72