PetaVision  Alpha
ConnectionData.hpp
1 /*
2  * ConnectionData.hpp
3  *
4  * Created on: Nov 17, 2017
5  * Author: pschultz
6  */
7 
8 #ifndef CONNECTIONDATA_HPP_
9 #define CONNECTIONDATA_HPP_
10 
11 #include "columns/BaseObject.hpp"
12 #include "layers/HyPerLayer.hpp"
13 
14 namespace PV {
15 
16 class ConnectionData : public BaseObject {
17  protected:
28  virtual void ioParam_preLayerName(enum ParamsIOFlag ioFlag);
29 
34  virtual void ioParam_postLayerName(enum ParamsIOFlag ioFlag); // end of ConnectionData parameters
36 
37  public:
38  ConnectionData(char const *name, HyPerCol *hc);
39  virtual ~ConnectionData();
40 
44  char const *getPreLayerName() const { return mPreLayerName; }
45 
49  char const *getPostLayerName() const { return mPostLayerName; }
50 
54  HyPerLayer *getPre() { return mPre; }
55 
59  HyPerLayer *getPost() { return mPost; }
60 
61  protected:
63 
64  int initialize(char const *name, HyPerCol *hc);
65 
66  virtual void setObjectType() override;
67 
68  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
69 
70  virtual Response::Status
71  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
72 
80  static void inferPreAndPostFromConnName(
81  const char *name,
82  int rank,
83  std::string &preLayerNameString,
84  std::string &postLayerNameString);
85 
86  protected:
87  char *mPreLayerName = nullptr;
88  char *mPostLayerName = nullptr;
89  HyPerLayer *mPre = nullptr;
90  HyPerLayer *mPost = nullptr;
91 
92 }; // class ConnectionData
93 
94 } // namespace PV
95 
96 #endif // CONNECTIONDATA_HPP_
char const * getPostLayerName() const
HyPerLayer * getPre()
virtual void ioParam_preLayerName(enum ParamsIOFlag ioFlag)
preLayerName: Specifies the connection&#39;s pre layer
virtual void ioParam_postLayerName(enum ParamsIOFlag ioFlag)
preLayerName: Specifies the connection&#39;s post layer
char const * getPreLayerName() const
HyPerLayer * getPost()
static void inferPreAndPostFromConnName(const char *name, int rank, std::string &preLayerNameString, std::string &postLayerNameString)
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override