Artec 3D Scanning SDK  2.0
IRef.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Reference counting. Base class for all interfaces.
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _IREF_H_
12 #define _IREF_H_
13 
14 namespace artec { namespace sdk { namespace base
15 {
16 
17 ///
18 /**
19 * Interface that implements reference counting and life-time management.
20 * It allows to release each object once it is not being used anymore.
21 */
22 class IRef
23 {
24 public:
25  /// Increase object reference counter.
26  ///
27  /// @return
28  /// Counter value
29  virtual int addRef() const = 0;
30 
31  /// Decrease object reference counter.
32  ///
33  /// @detailed
34  /// Destroy object and free allocated memory when counter = 0.
35  ///
36  /// @return
37  /// Counter value
38  virtual int release() const = 0;
39 };
40 
41 } } } // namespace artec::sdk::base
42 
43 #endif // _IREF_H_
virtual int addRef() const =0
Increase object reference counter.
virtual int release() const =0
Decrease object reference counter.
Interface that implements reference counting and life-time management.
Definition: IRef.h:22