NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkIGIDataSourceLocker.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkIGIDataSourceLocker_h
16 #define niftkIGIDataSourceLocker_h
17 
18 #include <niftkIGIDataSourcesExports.h>
19 #include <QMutex>
20 #include <QSet>
21 
22 namespace niftk
23 {
24 
29 class NIFTKIGIDATASOURCES_EXPORT IGIDataSourceLocker
30 {
31 
32 public:
33 
36 
37  int GetNextSourceNumber();
38  void RemoveSource(int);
39 
40 private:
41 
42  QMutex m_Lock;
43  QSet<int> m_SourcesInUse;
44 
45 };
46 
47 } // end namespace
48 
49 #endif
Helper class to provide a class-level counter.
Definition: niftkIGIDataSourceLocker.h:29
Definition: niftkExceptionObject.h:21