8 #include "FeedbackConnectionData.hpp" 9 #include "columns/HyPerCol.hpp" 10 #include "columns/ObjectMapComponent.hpp" 11 #include "components/OriginalConnNameParam.hpp" 12 #include "connections/HyPerConn.hpp" 13 #include "utils/MapLookupByType.hpp" 17 FeedbackConnectionData::FeedbackConnectionData(
char const *name, HyPerCol *hc) {
21 FeedbackConnectionData::FeedbackConnectionData() {}
23 FeedbackConnectionData::~FeedbackConnectionData() {}
25 int FeedbackConnectionData::initialize(
char const *name, HyPerCol *hc) {
26 return ConnectionData::initialize(name, hc);
29 void FeedbackConnectionData::setObjectType() { mObjectType =
"FeedbackConnectionData"; }
40 Response::Status FeedbackConnectionData::communicateInitInfo(
41 std::shared_ptr<CommunicateInitInfoMessage const> message) {
42 auto hierarchy = message->mHierarchy;
43 auto *originalConnNameParam =
44 mapLookupByType<OriginalConnNameParam>(hierarchy, getDescription());
46 originalConnNameParam ==
nullptr,
47 "%s requires an OriginalConnNameParam component.\n",
49 if (!originalConnNameParam->getInitInfoCommunicatedFlag()) {
50 return Response::POSTPONE;
52 char const *originalConnName = originalConnNameParam->getOriginalConnName();
53 pvAssert(originalConnName !=
nullptr);
56 mapLookupByType<ObjectMapComponent>(hierarchy, getDescription());
57 pvAssert(objectMapComponent);
58 HyPerConn *originalConn = objectMapComponent->lookup<
HyPerConn>(std::string(originalConnName));
59 if (originalConn ==
nullptr) {
60 if (parent->getCommunicator()->globalCommRank() == 0) {
62 "%s: originalConnName \"%s\" does not correspond to a HyPerConn in the column.\n",
66 MPI_Barrier(parent->getCommunicator()->globalCommunicator());
69 auto *originalConnectionData = originalConn->getComponentByType<
ConnectionData>();
71 originalConnectionData ==
nullptr,
72 "%s has original connection \"%s\", which does not have a ConnectionData component.\n",
74 originalConn->getName());
75 if (!originalConnectionData->getInitInfoCommunicatedFlag()) {
76 return Response::POSTPONE;
79 mPreLayerName = strdup(originalConnectionData->getPostLayerName());
81 mPostLayerName = strdup(originalConnectionData->getPreLayerName());
83 return ConnectionData::communicateInitInfo(message);
virtual void ioParam_postLayerName(enum ParamsIOFlag ioFlag) override
preLayerName: FeedbackConnectionData does not read the preLayerName parameter, but takes the pre and ...
virtual void ioParam_preLayerName(enum ParamsIOFlag ioFlag) override
preLayerName: FeedbackConnectionData does not read the preLayerName parameter, but takes the pre and ...
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override