00001 /*========================================================================= 00002 00003 Program: Open IGT Link Library 00004 Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlFastMutexLock.h $ 00005 Language: C++ 00006 Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $ 00007 Version: $Revision: 3460 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notices for more information. 00014 00015 =========================================================================*/ 00016 /*========================================================================= 00017 00018 Program: Insight Segmentation & Registration Toolkit 00019 Module: $RCSfile: itkFastMutexLock.h,v $ 00020 Language: C++ 00021 Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $ 00022 Version: $Revision: 3460 $ 00023 00024 Copyright (c) Insight Software Consortium. All rights reserved. 00025 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00026 00027 Portions of this code are covered under the VTK copyright. 00028 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. 00029 00030 This software is distributed WITHOUT ANY WARRANTY; without even 00031 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00032 PURPOSE. See the above copyright notices for more information. 00033 00034 =========================================================================*/ 00035 #ifndef __igtlFastMutexLock_h 00036 #define __igtlFastMutexLock_h 00037 00038 #include "igtlObject.h" 00039 #include "igtlSimpleFastMutexLock.h" 00040 #include "igtlObjectFactory.h" 00041 00042 namespace igtl 00043 { 00044 00066 class IGTLCommon_EXPORT FastMutexLock : public Object 00067 { 00068 public: 00070 typedef FastMutexLock Self; 00071 typedef Object Superclass; 00072 typedef SmartPointer<Self> Pointer; 00073 typedef SmartPointer<const Self> ConstPointer; 00074 00076 igtlNewMacro(Self); 00077 00079 igtlTypeMacro(FastMutexLock,Object); 00080 00082 void Lock(); 00083 00085 void Unlock(); 00086 00087 protected: 00088 FastMutexLock() {} 00089 ~FastMutexLock() {} 00090 00091 SimpleFastMutexLock m_SimpleFastMutexLock; 00092 void PrintSelf(std::ostream& os) const; 00093 00094 private: 00095 FastMutexLock(const Self&); //purposely not implemented 00096 void operator=(const Self&); //purposely not implemented 00097 }; 00098 00099 00100 inline void FastMutexLock::Lock( void ) 00101 { 00102 m_SimpleFastMutexLock.Lock(); 00103 } 00104 00105 inline void FastMutexLock::Unlock( void ) 00106 { 00107 m_SimpleFastMutexLock.Unlock(); 00108 } 00109 00110 00111 }//end igtl namespace 00112 #endif 00113 00114