PetaVision  Alpha
WTAConn.cpp
1 /*
2  * WTAConn.cpp
3  *
4  * Created on: Aug 15, 2018
5  * Author: pschultz
6  */
7 
8 #include "WTAConn.hpp"
9 #include "delivery/WTADelivery.hpp"
10 
11 namespace PV {
12 
13 WTAConn::WTAConn() {}
14 
15 WTAConn::WTAConn(const char *name, HyPerCol *hc) { initialize(name, hc); }
16 
17 int WTAConn::initialize(const char *name, HyPerCol *hc) {
18  int status = BaseConnection::initialize(name, hc);
19  return status;
20 }
21 
22 BaseDelivery *WTAConn::createDeliveryObject() {
23  BaseObject *baseObject = Factory::instance()->createByKeyword("WTADelivery", name, parent);
24  WTADelivery *deliveryObject = dynamic_cast<WTADelivery *>(baseObject);
25  pvAssert(deliveryObject);
26  return deliveryObject;
27 }
28 
29 void WTAConn::defineComponents() {
30  BaseConnection::defineComponents();
31  auto *singleArbor = createSingleArbor();
32  if (singleArbor) {
33  addObserver(singleArbor);
34  }
35 }
36 
37 SingleArbor *WTAConn::createSingleArbor() { return new SingleArbor(name, parent); }
38 
39 } // end of namespace PV block
virtual void addObserver(Observer *observer) override