PetaVision  Alpha
CloneDeliveryFacade.cpp
1 /*
2  * CloneDeliveryFacade.cpp
3  *
4  * Created on: Dec 18, 2017
5  * Author: Pete Schultz
6  */
7 
8 #include "CloneDeliveryFacade.hpp"
9 #include "columns/HyPerCol.hpp"
10 #include "components/CloneWeightsPair.hpp"
11 #include "utils/MapLookupByType.hpp"
12 
13 namespace PV {
14 
15 CloneDeliveryFacade::CloneDeliveryFacade(char const *name, HyPerCol *hc) { initialize(name, hc); }
16 
17 CloneDeliveryFacade::CloneDeliveryFacade() {}
18 
19 CloneDeliveryFacade::~CloneDeliveryFacade() {}
20 
21 int CloneDeliveryFacade::initialize(char const *name, HyPerCol *hc) {
22  return HyPerDeliveryFacade::initialize(name, hc);
23 }
24 
25 void CloneDeliveryFacade::setObjectType() { mObjectType = "CloneDeliveryFacade"; }
26 
27 Response::Status CloneDeliveryFacade::communicateInitInfo(
28  std::shared_ptr<CommunicateInitInfoMessage const> message) {
29  auto status = HyPerDeliveryFacade::communicateInitInfo(message);
30  if (!Response::completed(status)) {
31  return status;
32  }
33  if (mUpdateGSynFromPostPerspective) {
34  auto *cloneWeightsPair =
35  mapLookupByType<CloneWeightsPair>(message->mHierarchy, getDescription());
36  pvAssert(cloneWeightsPair);
37  cloneWeightsPair->synchronizeMarginsPost();
38  }
39  return Response::SUCCESS;
40 }
41 
42 } // end namespace PV
static bool completed(Status &a)
Definition: Response.hpp:49