lemon/bits/alteration_notifier.h
changeset 2388 c6d537888fe5
parent 2384 805c5a2a36dd
child 2391 14a343be7a5a
equal deleted inserted replaced
21:650f8e4038eb 22:8babe5604f42
   146       ObserverBase() : _notifier(0) {}
   146       ObserverBase() : _notifier(0) {}
   147 
   147 
   148       /// \brief Constructor which attach the observer into notifier.
   148       /// \brief Constructor which attach the observer into notifier.
   149       ///
   149       ///
   150       /// Constructor which attach the observer into notifier.
   150       /// Constructor which attach the observer into notifier.
   151       ObserverBase(AlterationNotifier& notifier) {
   151       ObserverBase(AlterationNotifier& nf) {
   152         attach(notifier);
   152         attach(nf);
   153       }
   153       }
   154 
   154 
   155       /// \brief Constructor which attach the obserever to the same notifier.
   155       /// \brief Constructor which attach the obserever to the same notifier.
   156       ///
   156       ///
   157       /// Constructor which attach the obserever to the same notifier as
   157       /// Constructor which attach the obserever to the same notifier as
   158       /// the other observer is attached to. 
   158       /// the other observer is attached to. 
   159       ObserverBase(const ObserverBase& copy) {
   159       ObserverBase(const ObserverBase& copy) {
   160 	if (copy.attached()) {
   160 	if (copy.attached()) {
   161           attach(*copy._notifier());
   161           attach(*copy.notifier());
   162 	}
   162 	}
   163       }
   163       }
   164 	
   164 	
   165       /// \brief Destructor
   165       /// \brief Destructor
   166       virtual ~ObserverBase() {
   166       virtual ~ObserverBase() {
   171 
   171 
   172       /// \brief Attaches the observer into an AlterationNotifier.
   172       /// \brief Attaches the observer into an AlterationNotifier.
   173       ///
   173       ///
   174       /// This member attaches the observer into an AlterationNotifier.
   174       /// This member attaches the observer into an AlterationNotifier.
   175       ///
   175       ///
   176       void attach(AlterationNotifier& notifier) {
   176       void attach(AlterationNotifier& nf) {
   177 	notifier.attach(*this);
   177 	nf.attach(*this);
   178       }
   178       }
   179       
   179       
   180       /// \brief Detaches the observer into an AlterationNotifier.
   180       /// \brief Detaches the observer into an AlterationNotifier.
   181       ///
   181       ///
   182       /// This member detaches the observer from an AlterationNotifier.
   182       /// This member detaches the observer from an AlterationNotifier.