PCMLock.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00027 
00028 #ifndef __PCM_LOCK_H__
00029 #  define __PCM_LOCK_H__
00030 
00031 
00032 
00033 
00034 
00035 #  include "PCMPremeditations.h"
00036 
00037 #  include "PCMException.h"
00038 
00039 namespace ParCompMark
00040 {
00041 
00046   class Lock
00047   {
00048 
00049         
00050         
00051         
00052 #  ifdef PARCOMPMARK_TEST
00053         friend class ParCompMarkTest::TestLock;
00054 #  endif
00055 
00056         
00057         
00058         
00059 
00061 
00062 
00063    protected:
00064 
00070         bool mLocked;
00071 
00073 
00074         
00075         
00076         
00077 
00079 
00080 
00081    public:
00082 
00086         Lock();
00087 
00091         virtual ~ Lock();
00092 
00094 
00095         
00096         
00097         
00098 
00100 
00101 
00102    public:
00103 
00109         const bool & getLocked() const;
00110 
00112 
00113         
00114         
00115         
00116 
00118 
00119 
00120    public:
00121 
00125         virtual void lock() = 0;
00126 
00131         virtual bool trylock() = 0;
00132 
00136         virtual void unlock() = 0;
00137 
00139 
00140   };
00141 
00142   
00143   
00144   
00145 
00146 #  include "PCMLock_impl.h"
00147 
00148 }
00149 
00150 #endif