Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlMutexLock.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: The OpenIGTLink Library
4 Language: C++
5 Web page: http://openigtlink.org/
6
7 Copyright (c) Insight Software Consortium. All rights reserved.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12
13=========================================================================*/
14/*=========================================================================
15
16 Program: Insight Segmentation & Registration Toolkit
17 Module: $RCSfile: itkMutexLock.h,v $
18 Language: C++
19 Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
20 Version: $Revision: 3460 $
21
22 Copyright (c) Insight Software Consortium. All rights reserved.
23 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
24
25 Portions of this code are covered under the VTK copyright.
26 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
27
28 This software is distributed WITHOUT ANY WARRANTY; without even
29 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30 PURPOSE. See the above copyright notices for more information.
31
32=========================================================================*/
33#ifndef __igtlMutexLock_h
34#define __igtlMutexLock_h
35
36#include "igtlObject.h"
37#include "igtlObjectFactory.h"
38
39#ifdef OpenIGTLink_USE_SPROC
40#include <abi_mutex.h>
41#endif
42
43#ifdef OpenIGTLink_USE_PTHREADS
44#include <pthread.h>
45#endif
46
47#ifdef OpenIGTLink_USE_WIN32_THREADS
48#include "igtlWindows.h"
49#endif
50
51namespace igtl
52{
53
54#ifdef OpenIGTLink_USE_SPROC
55typedef abilock_t MutexType;
56#endif
57
58#ifdef OpenIGTLink_USE_PTHREADS
59typedef pthread_mutex_t MutexType;
60#endif
61
62#ifdef OpenIGTLink_USE_WIN32_THREADS
63typedef HANDLE MutexType;
64#endif
65
66#ifndef OpenIGTLink_USE_SPROC
67#ifndef OpenIGTLink_USE_PTHREADS
68#ifndef OpenIGTLink_USE_WIN32_THREADS
69typedef int MutexType;
70#endif
71#endif
72#endif
73
84{
85public:
88
93
96 //void Delete() {delete this;}
98
100 virtual const char *GetNameOfClass() {return "igtlSimpleMutexLock";};
101
103 void Lock( void );
104
106 void Unlock( void );
107
110 {
111 return m_MutexLock;
112 }
114 {
115 return m_MutexLock;
116 }
118
119protected:
121};
122
133{
134public:
140
143
146
148 void Lock( void );
149
151 void Unlock( void );
152
153protected:
156
158 void PrintSelf(std::ostream& os) const;
159
160private:
161 MutexLock(const Self&); //purposely not implemented
162 void operator=(const Self&); //purposely not implemented
163};
164
165
166inline void MutexLock::Lock( void )
167{
169}
170
171inline void MutexLock::Unlock( void )
172{
174}
175
176
177}//end igtl namespace
178#endif
Mutual exclusion locking class.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
void PrintSelf(std::ostream &os) const
void Unlock(void)
igtlTypeMacro(MutexLock, Object)
SimpleMutexLock m_SimpleMutexLock
Base class for most igtl classes.
Definition igtlObject.h:61
Simple mutual exclusion locking class.
virtual const char * GetNameOfClass()
virtual ~SimpleMutexLock()
MutexType & GetMutexLock()
const MutexType GetMutexLock() const
SimpleMutexLock Self
static SimpleMutexLock * New()
Implements transparent reference counting.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
int MutexType

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012