Home | C-Bits Package Documentation | Project Page |
00001 /* ==================================================================== 00002 * The CBITS Software License, Version 1.0 00003 * 00004 * Copyright (c) 2002-2003 Bruce Lowery 00005 * All rights reserved 00006 * 00007 * Redistribution and use of this software, in source and binary forms, 00008 * with or without modification, are permitted provided that the above 00009 * copyright notice, this paragraph, and the following paragraph are 00010 * retained in each source code file. 00011 * 00012 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00013 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00014 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00015 * DISCLAIMED. IN NO EVENT SHALL BRUCE LOWERY OR OTHER CONTRIBUTORS 00016 * TO THE CBITS LIBRARY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00017 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00018 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00019 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00020 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00021 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00022 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00023 * SUCH DAMAGE. 00024 * ==================================================================== 00025 */ 00026 #ifndef __SIGNAL_OBJECT_H__ 00027 #define __SIGNAL_OBJECT_H__ 00028 00029 #ifdef BUILD_DLL 00030 #define EXPORT __declspec(dllexport) 00031 #else 00032 #define EXPORT 00033 #endif 00034 00035 namespace cbits 00036 { 00037 00055 class EXPORT SignalObject 00056 { 00057 public: 00063 static SignalObject* create(); 00064 00065 00071 const bool wait 00072 ( 00078 const long msec = 0 00079 ); 00080 00081 00087 const bool notify(); 00088 00089 00095 const bool notifyAll(); 00096 00097 00101 virtual ~SignalObject(); 00102 00103 00104 protected: 00105 00106 SignalObject(); 00107 00108 virtual const bool impl_wait( const long msec=0 ) = 0; 00109 virtual const bool impl_notify() = 0; 00110 virtual const bool impl_notify_all() = 0; 00111 00112 private: 00113 /* not implemented */ 00114 SignalObject( const SignalObject& ); 00115 SignalObject& operator=( const SignalObject& ); 00116 }; 00117 00118 }; 00119 00120 #endif 00121 00122 /* 00123 * $Id: SignalObject.h,v 1.3 2002/10/07 21:07:43 brulow Exp $ 00124 * 00125 * History: (Add nothing manually below) 00126 * ----------------------------------------------------------------------- 00127 * 00128 * $Log: SignalObject.h,v $ 00129 * Revision 1.3 2002/10/07 21:07:43 brulow 00130 * Add/improve documentation 00131 * 00132 * Revision 1.2 2002/10/07 02:55:01 brulow 00133 * Add SignalObject to thread pkg 00134 * 00135 * 00136 */
|
|