PetaVision  Alpha
CheckpointEntryPvpBuffer.hpp
1 /*
2  * CheckpointEntryPvpBuffer.hpp
3  *
4  * Created on Sep 27, 2016
5  * Author: Pete Schultz
6  */
7 
8 #ifndef CHECKPOINTENTRYPVPBUFFER_HPP_
9 #define CHECKPOINTENTRYPVPBUFFER_HPP_
10 
11 #include "CheckpointEntryPvp.hpp"
12 #include "include/PVLayerLoc.h"
13 #include <string>
14 
15 namespace PV {
16 
17 template <typename T>
19  public:
21  std::string const &name,
22  MPIBlock const *mpiBlock,
23  T *dataPtr,
24  PVLayerLoc const *layerLoc,
25  bool extended)
26  : CheckpointEntryPvp<T>(name, mpiBlock, layerLoc, extended), mDataPointer(dataPtr) {}
28  std::string const &objName,
29  std::string const &dataName,
30  MPIBlock const *mpiBlock,
31  T *dataPtr,
32  PVLayerLoc const *layerLoc,
33  bool extended)
34  : CheckpointEntryPvp<T>(objName, dataName, mpiBlock, layerLoc, extended),
35  mDataPointer(dataPtr) {}
36 
37  protected:
38  virtual int getNumFrames() const override;
39  virtual T *calcBatchElementStart(int batchElement) const override;
40  virtual int calcMPIBatchIndex(int frame) const override;
41 
42  T *getDataPointer() const { return mDataPointer; }
43 
44  private:
45  T *mDataPointer = nullptr;
46 };
47 
48 } // end namespace PV
49 
50 #include "CheckpointEntryPvpBuffer.tpp"
51 
52 #endif // CHECKPOINTENTRYPVPBUFFER_HPP_