~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/src/observer.h

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-12-24 16:33:55 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101224163355-tkvvikqxbrbav6up
Tags: 0.9.11-1
* New upstream release
* Add new build dependencies on libwebkit-dev and libyaml-dev

* Bump Standards-Version up to 3.9.1
* Bump debhelper compatibility to 8
* Patch another typo in the upstream code (lintian notice)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
/**
37
37
 * Observer design pattern interface
38
38
 */
39
 
namespace Pattern {
 
39
namespace Pattern
 
40
{
40
41
 
41
42
/**
42
43
 * Observer interface
43
44
 */
44
 
class Observer {
45
 
public:
46
 
  virtual ~Observer() {};
47
 
  virtual void update() = 0;
 
45
class Observer
 
46
{
 
47
    public:
 
48
        virtual ~Observer() {};
 
49
        virtual void update() = 0;
48
50
};
49
51
 
50
 
class Subject {
51
 
public:
52
 
  virtual ~Subject() {};
53
 
  void attach(Observer& observer);
54
 
  void detach(Observer& observer);
55
 
  void notify();
 
52
class Subject
 
53
{
 
54
    public:
 
55
        virtual ~Subject() {};
 
56
        void attach (Observer& observer);
 
57
        void detach (Observer& observer);
 
58
        void notify();
56
59
 
57
 
private:
58
 
  std::list<Observer*> _observers;
 
60
    private:
 
61
        std::list<Observer*> _observers;
59
62
};
60
63
 
61
64
} // end namespace