00001 #ifndef AUTOSYNCHRONIZER_CLASS 00002 #define AUTOSYNCHRONIZER_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : auto_synchronizer * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2000-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #include "object_base.h" 00019 00021 00058 class auto_synchronizer 00059 { 00060 public: 00061 auto_synchronizer(synchronizer_base &locker) : _locker(locker) 00062 { _locker.establish_lock(); } 00064 00069 ~auto_synchronizer() { _locker.repeal_lock(); } 00071 00072 private: 00073 synchronizer_base &_locker; 00074 00075 // disallowed. 00076 auto_synchronizer(const auto_synchronizer &locker); 00077 auto_synchronizer &operator =(const auto_synchronizer &locker); 00078 }; 00079 00080 #endif 00081
1.5.1