Ignore:
Timestamp:
Dec 23, 2011, 10:14:52 AM (14 years ago)
Author:
Frederik Heber <heber@…>
Children:
f16f05
Parents:
760f97c
Message:

Fix to Relay::recieveNotifications() for not caring for present Channels or not.

  • We do not ascertain presence of Channels, if there are none, nothing is sent on.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Observer/Relay.cpp

    r760f97c r444a2f  
    210210{
    211211  Updater = publisher;
    212   const Channels *myChannels = NotificationChannels[const_cast<Observable *>(static_cast<const Observable * const>(this))];
    213   ASSERT(myChannels != NULL,
    214       "Relay::recieveNotification() - this relay does not have any channels.");
    215   const size_t channelno = notification->getChannelNo();
    216   Notification_ptr mynotification = myChannels->getChannel(channelno);
    217   ASSERT(mynotification != NULL,
    218       "Relay::recieveNotification() - this relay does not have a notification no "+toString(channelno)+".");
    219   mynotification->notifyAll(Updater);
    220   Updater = NULL;
     212  ChannelMap::const_iterator iter = NotificationChannels.find(this);
     213  if (iter != NotificationChannels.end()) {
     214    const Channels *myChannels = iter->second;
     215    const size_t channelno = notification->getChannelNo();
     216    Notification_ptr mynotification = myChannels->getChannel(channelno);
     217    ASSERT(mynotification != NULL,
     218        "Relay::recieveNotification() - this relay does not have a notification no "+toString(channelno)+".");
     219    mynotification->notifyAll(Updater);
     220    Updater = NULL;
     221  } else {
     222    // note that this relay does not seem to have any channels
     223  }
    221224}
    222225
Note: See TracChangeset for help on using the changeset viewer.