RxDock
0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
include
rxdock
Observer.h
1
/***********************************************************************
2
* The rDock program was developed from 1998 - 2006 by the software team
3
* at RiboTargets (subsequently Vernalis (R&D) Ltd).
4
* In 2006, the software was licensed to the University of York for
5
* maintenance and distribution.
6
* In 2012, Vernalis and the University of York agreed to release the
7
* program as Open Source software.
8
* This version is licensed under GNU-LGPL version 3.0 with support from
9
* the University of Barcelona.
10
* http://rdock.sourceforge.net/
11
***********************************************************************/
12
13
// Abstract Observer class for Subject-Observer design pattern, see Subject.h
14
// Design considerations:
15
// Subclasses should override the Update and Deleted methods, which are invoked
16
// by the subject when the subject changes state or is about to be deleted,
17
// respectively.
18
// Observer subclasses also need to store a pointer to the concrete subject
19
// subclass (e.g. WorkSpace), either via Register and Unregister methods or
20
// via the constructor, so that subject subclass methods can be called to get
21
// details of the change in state. No pointer to the base subject object is
22
// stored in the base observer object.
23
24
#ifndef _RBTOBSERVER_H_
25
#define _RBTOBSERVER_H_
26
27
#include <vector>
28
29
namespace
rxdock {
30
31
class
Subject;
32
33
class
Observer
{
34
public
:
36
// Constructors/destructors
37
virtual
~Observer
();
// Default destructor
38
40
// Public methods
42
// PURE VIRTUAL - DERIVED CLASSES MUST OVERRIDE
43
// Notify observer that subject has changed
44
virtual
void
Update(
Subject
*theChangedSubject) = 0;
45
// Notify observer that subject is about to be deleted
46
virtual
void
Deleted(
Subject
*theDeletedSubject) = 0;
47
48
protected
:
50
// Protected methods
52
Observer
();
53
54
private
:
56
// Private methods
58
Observer
(
const
Observer
&);
// Copy constructor disabled by default
59
Observer
&operator=(
const
Observer
&);
// Copy assignment disabled by default
60
61
protected
:
63
// Protected data
65
66
private
:
68
// Private data
70
};
71
72
// Useful typedefs
73
typedef
std::vector<Observer *> ObserverList;
74
typedef
ObserverList::iterator ObserverListIter;
75
typedef
ObserverList::const_iterator ObserverListConstIter;
76
77
}
// namespace rxdock
78
79
#endif
//_RBTOBSERVER_H_
rxdock::Observer
Definition
Observer.h:33
rxdock::Subject
Definition
Subject.h:35
Generated by
1.9.7