Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Handle.h

Go to the documentation of this file.
00001 #ifndef HANDLEWRAPPER_H
00002 #define HANDLEWRAPPER_H
00003 
00004 #include <abuse/abuse.h>
00005 
00006 class Handle
00007 {
00008 public:
00009 #ifdef WIN32
00010         Handle(CONDVARPTR h=NULL):handle(h){}
00011 #else
00012         Handle(CONDVARPTR h=NULL):handle(new CONDVAR()){*handle=*h;}
00013 #endif
00014         virtual ~Handle()
00015         {
00016 #ifdef WIN32
00017                 CloseHandle(handle);
00018 #else
00019                 pthread_cond_destroy(handle);
00020                 delete handle;
00021 #endif
00022         }
00023         CONDVARPTR get()const
00024         {
00025                 return handle;
00026         }
00027         operator CONDVARPTR()const
00028         {
00029                 return get();
00030         }
00031 protected:
00032         CONDVARPTR handle;
00033 };
00034 
00035 #endif  

Generated on Thu Jun 16 00:13:14 2005 for Netlib for Abuse! by  doxygen 1.4.3