/usr/include/vtkDICOMReferenceCount.h is in libvtk-dicom-dev 0.7.10-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | /*=========================================================================
Program: DICOM for VTK
Copyright (c) 2012-2015 David Gobbi
All rights reserved.
See Copyright.txt or http://dgobbi.github.io/bsd3.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef vtkDICOMReferenceCount_h
#define vtkDICOMReferenceCount_h
#include <vtkSystemIncludes.h>
#include "vtkDICOMModule.h" // For export macro
//! An object for holding an atomic reference count.
/*!
* The vtkDICOMValue class is a reference-counted container.
* In order to safely access values from multiple threads, all
* operations that modify the reference count must be atomic.
*/
class VTKDICOM_EXPORT vtkDICOMReferenceCount
{
public:
vtkDICOMReferenceCount(unsigned int i) : Counter(i) {}
vtkDICOMReferenceCount() : Counter(0) {}
unsigned int operator--();
unsigned int operator++();
bool operator==(unsigned int x) const {
return this->Counter == x; }
bool operator!=(unsigned int x) const {
return this->Counter != x; }
private:
unsigned int Counter;
};
#if !defined(_WIN32)
inline unsigned int vtkDICOMReferenceCount::operator--()
{
#if defined(VTK_HAVE_SYNC_BUILTINS)
return __sync_sub_and_fetch(&this->Counter, 1);
#else
return --this->Counter;
#endif
}
#endif
#if !defined(_WIN32)
inline unsigned int vtkDICOMReferenceCount::operator++()
{
#if defined(VTK_HAVE_SYNC_BUILTINS)
return __sync_add_and_fetch(&this->Counter, 1);
#else
return ++this->Counter;
#endif
}
#endif
#endif /* vtkDICOMReferenceCount_h */
// VTK-HeaderTest-Exclude: vtkDICOMReferenceCount.h
|