00001 /* 00002 * event.h 00003 * This file is part of dbPager Classes Library (DCL) 00004 * 00005 * Copyright (c) 2008 Dennis Prochko <wolfsoft@mail.ru> 00006 * 00007 * DCL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation version 3. 00010 * 00011 * DCL is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with DCL; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, 00019 * Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef _EVENT_H_ 00023 #define _EVENT_H_ 00024 00025 #include <dcl/exception.h> 00026 #include <dcl/mutex.h> 00027 00028 namespace dbp { 00029 00030 class event_int { 00031 public: 00032 virtual ~event_int() { } 00033 virtual void wait() = 0; 00034 virtual void raise() = 0; 00035 }; 00036 00038 00051 class event: public event_int { 00052 public: 00054 00059 event(mutex &m); 00061 virtual ~event(); 00063 00070 virtual void wait(); 00072 00076 virtual void raise(); 00077 private: 00078 event_int *pimpl; 00079 mutex &_m; 00080 }; 00081 00082 } //namespace 00083 00084 #endif /*_EVENT_H_*/