Ignore:
Timestamp:
Dec 13, 2011, 9:43:39 AM (14 years ago)
Author:
Frederik Heber <heber@…>
Children:
e2e035e
Parents:
e7352a5
git-author:
Frederik Heber <heber@…> (12/01/11 09:09:18)
git-committer:
Frederik Heber <heber@…> (12/13/11 09:43:39)
Message:

NotificationChannels is now static entity.

  • this is in line with the other static entities on Observable that are intended to save memory (before we needed 8 bytes for the pointer in each and every Observable instances, whether it had channels or not.)
  • Modified NOTIFY macro to accomodate for the changes.
  • enhanced documentation of class Notifications.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Patterns/unittests/stubs/ObserverStub.cpp

    re7352a5 rbc2698  
    132132  Observable("NotificationObservable")
    133133{
    134   NotificationChannels = new Channels(this);
    135   NotificationChannels->addChannel(Operation1Notify);
    136   NotificationChannels->addChannel(Operation2Notify);
     134  Channels *OurChannel = new Channels(this);
     135  NotificationChannels.insert( std::make_pair(this, OurChannel) );
     136  OurChannel->addChannel(Operation1Notify);
     137  OurChannel->addChannel(Operation2Notify);
    137138}
    138139
    139140NotificationObservable::~NotificationObservable()
    140141{
    141   delete NotificationChannels;
     142  NotificationChannels.erase(this);
    142143}
    143144
Note: See TracChangeset for help on using the changeset viewer.