22 if (
auto subscriber_sptr = subscriber_wptr.lock())
24 subscriber_sptr->ReceiveEventUpdate(event);
29 <<
publisher_name_ <<
" published event name \"" <<
event.Name() <<
"\"";
33 std::shared_ptr<chi::EventSubscriber>& subscriber_sptr)
35 std::weak_ptr<chi::EventSubscriber> wptr = subscriber_sptr;
40 [&wptr](
const std::weak_ptr<chi::EventSubscriber>& ptr1)
41 { return ptr1.lock() == wptr.lock(); });
EventPublisher(const std::string &name)
std::vector< std::weak_ptr< chi::EventSubscriber > > subscribers_
void AddSubscriber(std::shared_ptr< chi::EventSubscriber > &subscriber_sptr)
const std::string publisher_name_
virtual void PublishEvent(const chi::Event &event)