PetaVision  Alpha
WeightsPairInterface.hpp
1 /*
2  * WeightsPairInterface.hpp
3  *
4  * Created on: Jan 8, 2018
5  * Author: Pete Schultz
6  */
7 
8 #ifndef WEIGHTSPAIRINTERFACE_HPP_
9 #define WEIGHTSPAIRINTERFACE_HPP_
10 
11 #include "columns/BaseObject.hpp"
12 #include "components/ConnectionData.hpp"
13 #include "components/PatchSize.hpp"
14 #include "components/Weights.hpp"
15 
16 namespace PV {
17 
19  public:
20  WeightsPairInterface(char const *name, HyPerCol *hc);
21 
22  virtual ~WeightsPairInterface();
23 
31  void needPre();
32 
40  void needPost();
41 
42  Weights *getPreWeights() { return mPreWeights; }
43  Weights *getPostWeights() { return mPostWeights; }
44 
45  ConnectionData const *getConnectionData() { return mConnectionData; }
46 
47  protected:
49 
50  int initialize(char const *name, HyPerCol *hc);
51 
52  virtual void setObjectType() override;
53 
54  virtual Response::Status
55  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
56 
64  virtual void createPreWeights(std::string const &weightsName) = 0;
65 
73  virtual void createPostWeights(std::string const &weightsName) = 0;
74 
75  virtual Response::Status allocateDataStructures() override;
76 
77  virtual void allocatePreWeights();
78 
79  virtual void allocatePostWeights();
80 
81  protected:
82  PatchSize *mPatchSize = nullptr;
83  ConnectionData *mConnectionData = nullptr;
84 
85  Weights *mPreWeights = nullptr;
86  Weights *mPostWeights = nullptr;
87 };
88 
89 } // namespace PV
90 
91 #endif // WEIGHTSPAIRINTERFACE_HPP_
virtual void createPostWeights(std::string const &weightsName)=0
virtual void createPreWeights(std::string const &weightsName)=0