Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxSharedPointerChecker.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXSHAREDPOINTERCHECKER_H
12 #define CXSHAREDPOINTERCHECKER_H
13 
14 #include "cxResourceExport.h"
15 
16 #include "boost/shared_ptr.hpp"
17 #include <QString>
18 
19 namespace cx
20 {
21 
28 cxResource_EXPORT void requireUnique(int use_count, QString objectName);
29 
36 template<class T>
37 void requireUnique(const boost::shared_ptr<T>& object, QString objectName)
38 {
39  requireUnique(object.use_count(), objectName);
40 }
41 
46 } // namespace cx
47 
48 
49 #endif // CXSHAREDPOINTERCHECKER_H
void requireUnique(int use_count, QString objectName)
Namespace for all CustusX production code.