BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
Subject Class Reference

#include <Observer.h>

Public Member Functions

 Subject ()
 
void attach (Observer *anObserver)
 
void detach (Observer *)
 
void notify ()
 
 Subject ()
 
void attach (Observer *anObserver)
 
void detach (Observer *)
 
void notify ()
 

Detailed Description

Constructor & Destructor Documentation

◆ Subject() [1/2]

Subject::Subject ( )
inline

Definition at line 73 of file Calibration/facilities/facilities-00-00-04/facilities/Observer.h.

75 : m_observers()
76 //## end Subject::Subject%894312586.initialization
77 {
78 //## begin Subject::Subject%894312586.body preserve=yes
79 //## end Subject::Subject%894312586.body
80 }

◆ Subject() [2/2]

Subject::Subject ( )
inline

Definition at line 73 of file InstallArea/include/facilities/facilities/Observer.h.

75 : m_observers()
76 //## end Subject::Subject%894312586.initialization
77 {
78 //## begin Subject::Subject%894312586.body preserve=yes
79 //## end Subject::Subject%894312586.body
80 }

Member Function Documentation

◆ attach() [1/2]

void Subject::attach ( Observer anObserver)
inline

Definition at line 86 of file Calibration/facilities/facilities-00-00-04/facilities/Observer.h.

87 {
88 //## begin Subject::attach%892143867.body preserve=yes
89 m_observers.push_back(anObserver);
90 //## end Subject::attach%892143867.body
91 }

◆ attach() [2/2]

void Subject::attach ( Observer anObserver)
inline

Definition at line 86 of file InstallArea/include/facilities/facilities/Observer.h.

87 {
88 //## begin Subject::attach%892143867.body preserve=yes
89 m_observers.push_back(anObserver);
90 //## end Subject::attach%892143867.body
91 }

◆ detach() [1/2]

void Subject::detach ( Observer )
inline

Definition at line 95 of file Calibration/facilities/facilities-00-00-04/facilities/Observer.h.

96 {
97 //## begin Subject::detach%892143868.body preserve=yes
98 //std::vector<Observer*>::const_iterator it = m_observers.find(anObserver);
99 //if (it != m_observers.end()) m_observers.erase(it);
100 //## end Subject::detach%892143868.body
101 }

◆ detach() [2/2]

void Subject::detach ( Observer )
inline

Definition at line 95 of file InstallArea/include/facilities/facilities/Observer.h.

96 {
97 //## begin Subject::detach%892143868.body preserve=yes
98 //std::vector<Observer*>::const_iterator it = m_observers.find(anObserver);
99 //if (it != m_observers.end()) m_observers.erase(it);
100 //## end Subject::detach%892143868.body
101 }

◆ notify() [1/2]

void Subject::notify ( )
inline

Definition at line 105 of file Calibration/facilities/facilities-00-00-04/facilities/Observer.h.

106 {
107 //## begin Subject::notify%892143869.body preserve=yes
108 std::vector<Observer*>::iterator it = m_observers.begin();
109 while (it != m_observers.end()) {
110 if (*it) (*it)->update();
111 it++;
112 }
113 //## end Subject::notify%892143869.body
114 }

◆ notify() [2/2]

void Subject::notify ( )
inline

Definition at line 105 of file InstallArea/include/facilities/facilities/Observer.h.

106 {
107 //## begin Subject::notify%892143869.body preserve=yes
108 std::vector<Observer*>::iterator it = m_observers.begin();
109 while (it != m_observers.end()) {
110 if (*it) (*it)->update();
111 it++;
112 }
113 //## end Subject::notify%892143869.body
114 }

The documentation for this class was generated from the following files: