9 #ifndef BASECONNECTION_HPP_ 10 #define BASECONNECTION_HPP_ 12 #include "columns/BaseObject.hpp" 13 #include "components/ConnectionData.hpp" 14 #include "delivery/BaseDelivery.hpp" 15 #include "observerpattern/Subject.hpp" 16 #include "utils/MapLookupByType.hpp" 17 #include "utils/Timer.hpp" 32 S *getComponentByType();
34 virtual Response::Status respond(std::shared_ptr<BaseMessage const> message)
override;
40 mDeliveryObject->deliver();
44 void deliverUnitInput(
float *recvBuffer) { mDeliveryObject->deliverUnitInput(recvBuffer); }
50 char const *getPreLayerName()
const {
return mConnectionData->
getPreLayerName(); }
51 char const *getPostLayerName()
const {
return mConnectionData->
getPostLayerName(); }
53 ChannelType getChannelCode()
const {
return mDeliveryObject->getChannelCode(); }
54 bool getReceiveGpu()
const {
return mDeliveryObject->getReceiveGpu(); }
59 int initialize(
char const *name,
HyPerCol *hc);
61 virtual void defineComponents();
69 respondConnectionWriteParams(std::shared_ptr<ConnectionWriteParamsMessage const> message);
72 respondConnectionFinalizeUpdate(std::shared_ptr<ConnectionFinalizeUpdateMessage const> message);
74 Response::Status respondConnectionOutput(std::shared_ptr<ConnectionOutputMessage const> message);
76 virtual Response::Status
77 communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message)
override;
80 virtual Response::Status
81 setCudaDevice(std::shared_ptr<SetCudaDeviceMessage const> message)
override;
84 virtual Response::Status allocateDataStructures()
override;
86 virtual Response::Status registerData(
Checkpointer *checkpointer)
override;
88 virtual void deleteComponents();
97 Timer *mIOTimer =
nullptr;
101 template <
typename S>
102 S *BaseConnection::getComponentByType() {
103 return mapLookupByType<S>(mComponentTable.getObjectMap(), getDescription());
108 #endif // BASECONNECTION_HPP_ char const * getPostLayerName() const
int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void addObserver(Observer *observer) override
char const * getPreLayerName() const
virtual bool isAllInputReady()