Ignore:
Timestamp:
Sep 1, 2011, 1:51:25 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Children:
d45509
Parents:
74e0f7
Message:

Observable::signOn/Off functions are now on const instance possible.

  • maps of Observable are static anyway.
  • we need some const_casts as instances in maps (which we need as lookup key in sign on/off) are non-const.
  • whether there are more or fewer observers does not impact on the constness of a class but only affects a mutable part.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Patterns/Observer.hpp

    r74e0f7 r9e776f  
    122122   * ussually no need to order the update sequence.
    123123   */
    124   virtual void signOn(Observer *target, int priority=0);
     124  virtual void signOn(Observer *target, int priority=0) const;
    125125
    126126  /**
     
    128128   * updates will be recieved from that observer.
    129129   */
    130   virtual void signOff(Observer *target);
     130  virtual void signOff(Observer *target) const;
    131131
    132132  /**
    133133   * Sign on for specialized notifications
    134134   */
    135   virtual void signOn(Observer *target, Notification_ptr notification);
     135  virtual void signOn(Observer *target, Notification_ptr notification) const;
    136136
    137137  /**
    138138   * Stop receiving a specialized notification
    139139   */
    140   virtual void signOff(Observer *target, Notification_ptr notification);
     140  virtual void signOff(Observer *target, Notification_ptr notification) const;
    141141
    142142  /**
     
    144144   * Changes are in Progress, that are not yet published.
    145145   */
    146   virtual bool isBlocked();
     146  virtual bool isBlocked() const;
    147147
    148148  Notification_ptr getChannel(size_t no) const;
Note: See TracChangeset for help on using the changeset viewer.