00001
00002 #ifndef IGSLISTENER_SCOPED_BLOCK
00003 #define IGSLISTENER_SCOPED_BLOCK
00004
00005 namespace listener {
00006
00007 template <typename T>
00008 class ScopedBlock {
00009 public:
00010 ScopedBlock(T* t) ;
00011 ~ScopedBlock() ;
00012 private:
00013 T* t_ ;
00014 } ;
00015
00016
00017
00018
00019
00020 template <typename T>
00021 inline ScopedBlock<T>::ScopedBlock(T* t): t_(t) {
00022 assert(t) ;
00023 t_->block_events() ;
00024 }
00025
00026 template <typename T>
00027 inline ScopedBlock<T>::~ScopedBlock() {
00028 t_->unblock_events() ;
00029 }
00030
00031 }
00032
00033 #endif