MeVisLab Toolbox Reference
mlMetaProfilePtr.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2010, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_META_PROFILE_PTR_H
14 #define ML_META_PROFILE_PTR_H
15 
17 
18 class MLMetaProfile;
19 
20 
23 {
24 public:
27 
28  void createMetaProfile(const std::string& description);
29 
30  MLMetaProfile* operator->() const { return _metaProfile; }
31  MLMetaProfile& operator*() { return *_metaProfile; }
32  const MLMetaProfile& operator*() const { return *_metaProfile; }
33 
34  MLMetaProfile* get() const { return _metaProfile; }
35 
36  operator bool() const { return _metaProfile != nullptr; }
37 
38 private:
39  // disallow copying of the meta profile pointer, because the meta profile
40  // supports only one callback.
42  MLMetaProfilePtr& operator=(const MLMetaProfilePtr&);
43 
44  void metaProfileIsDestroyed();
45 
46 private:
47  MLMetaProfile* _metaProfile;
48 
49  friend class MLMetaProfile;
50 };
51 
52 #endif // _ML_META_PROFILE_PTR_H_
The pointer is automatically reset when the meta profile is destroyed.
MLMetaProfile * get() const
void createMetaProfile(const std::string &description)
const MLMetaProfile & operator*() const
MLMetaProfile & operator*()
MLMetaProfile * operator->() const
#define MLPROFILINGMANAGER_EXPORT