PetaVision  Alpha
PoolingConn.cpp
1 /*
2  * PoolingConn.cpp
3  *
4  * Created on: Feburary 27, 2014
5  * Author: slundquist
6  */
7 
8 #include "PoolingConn.hpp"
9 #include "columns/HyPerCol.hpp"
10 #include "components/PatchSize.hpp"
11 #include "delivery/PoolingDelivery.hpp"
12 
13 namespace PV {
14 
15 PoolingConn::PoolingConn(char const *name, HyPerCol *hc) { initialize(name, hc); }
16 
17 PoolingConn::PoolingConn() {}
18 
19 PoolingConn::~PoolingConn() {}
20 
21 int PoolingConn::initialize(char const *name, HyPerCol *hc) {
22  int status = BaseConnection::initialize(name, hc);
23  return status;
24 }
25 
26 void PoolingConn::defineComponents() {
27  BaseConnection::defineComponents();
28  mPatchSize = createPatchSize();
29  if (mPatchSize) {
30  addObserver(mPatchSize);
31  }
32  mWeightsPair = createWeightsPair();
33  if (mWeightsPair) {
34  addObserver(mWeightsPair);
35  }
36 }
37 
38 BaseDelivery *PoolingConn::createDeliveryObject() { return new PoolingDelivery(name, parent); }
39 
40 PatchSize *PoolingConn::createPatchSize() { return new PatchSize(name, parent); }
41 
42 WeightsPairInterface *PoolingConn::createWeightsPair() {
43  return new ImpliedWeightsPair(name, parent);
44 }
45 
46 } // namespace PV
virtual void addObserver(Observer *observer) override