Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

watcher.h

Go to the documentation of this file.
00001 // watcher.h
00002 // 
00003 // Copyright (C) 2002, Chris Laurel <claurel@shatters.net>
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 #ifndef _CELUTIL_WATCHER_H_
00011 #define _CELUTIL_WATCHER_H_
00012 
00013 template<class T> class Watcher
00014 {
00015  private:
00016     T& watched;
00017 
00018  public:
00019     Watcher(T& _watched) : watched(_watched)
00020     {
00021         watched.addWatcher(this);
00022     };
00023 
00024     virtual ~Watcher()
00025     {
00026         watched.removeWatcher(this);
00027     }
00028 
00029     virtual void notifyChange(T*, int) = 0;
00030 };
00031 
00032 #endif // _CELUTIL_WATCHER_H_

Generated on Sat Jan 14 22:30:32 2006 for Celestia by  doxygen 1.4.1