AmpTools
MISubject.cc
Go to the documentation of this file.
1 
2 // This file is a part of MinuitInterface - a front end for the Minuit minimization
3 // package (Minuit itself was authored by Fred James, of CERN)
4 //
5 //
6 // Copyright Cornell University 1993, 1996, All Rights Reserved.
7 //
8 // This software written by Lawrence Gibbons, Cornell University.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions
12 // are met:
13 // 1. Redistributions of source code must retain the above copyright
14 // notice and author attribution, this list of conditions and the
15 // following disclaimer.
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice and author attribution, this list of conditions and the
18 // following disclaimer in the documentation and/or other materials
19 // provided with the distribution.
20 // 3. Neither the name of the University nor the names of its contributors
21 // may be used to endorse or promote products derived from this software
22 // without specific prior written permission.
23 //
24 // Creation of derivative forms of this software for commercial
25 // utilization may be subject to restriction; written permission may be
26 // obtained from Cornell University.
27 //
28 // CORNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way
29 // of example, but not limitation, CORNELL MAKES NO REPRESENTATIONS OR
30 // WARRANTIES OF MERCANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
31 // THE USE OF THIS SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS,
32 // COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. Cornell University shall not be
33 // held liable for any liability with respect to any claim by the user or any
34 // other party arising from use of the program.
35 //
36 
39 
41  m_observerList()
42 {}
43 
45 {}
46 
47 void
48 MISubject::attach( MIObserver* anMIObserver ) {
49 
50  m_observerList.push_back( anMIObserver );
51 }
52 
53 void
54 MISubject::detach( MIObserver* anMIObserver ) {
55 
56  m_observerList.remove( anMIObserver );
57 }
58 
59 void
61 
62  ObserverList::iterator iter = m_observerList.begin();
63  for ( ; iter != m_observerList.end(); ++iter ) {
64  (*iter)->update( this );
65  }
66 }
void notify()
Definition: MISubject.cc:60
void attach(MIObserver *)
Definition: MISubject.cc:48
void detach(MIObserver *)
Definition: MISubject.cc:54
virtual ~MISubject()
Definition: MISubject.cc:44