PetaVision  Alpha
CheckpointingMessages.hpp
1 #include "observerpattern/BaseMessage.hpp"
2 
3 namespace PV {
4 
5 template <typename T> // In practice, T is always Checkpointer.
6 // Templated to avoid including Checkpointer.hpp in this file.
8  public:
9  RegisterDataMessage(T *dataRegistry) {
10  setMessageType("RegisterCheckpointDataMessage");
11  mDataRegistry = dataRegistry;
12  }
13  T *mDataRegistry;
14 };
15 
16 
17 template <typename T> // In practice, T is always Checkpointer.
19  public:
20  ReadStateFromCheckpointMessage(T *dataRegistry) {
21  setMessageType("ReadStateFromCheckpoint");
22  mDataRegistry = dataRegistry;
23  }
24  T *mDataRegistry;
25 };
26 
28  public:
29  ProcessCheckpointReadMessage(std::string const &directory) : mDirectory(directory) {
30  setMessageType("ProcessCheckpointReadMessage");
31  }
32  std::string mDirectory;
33 };
34 
36  public:
37  PrepareCheckpointWriteMessage(std::string const &directory) : mDirectory(directory) {
38  setMessageType("ProcessCheckpointWriteMessage");
39  }
40  std::string mDirectory;
41 };
42 
43 } // end namespace PV