Mobile API Reference  MicroStrategy 2019
ReferenceCounted.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : ReferenceCounted.h
3 // AUTHOR : Juan Pablo Muraira
4 // CREATION : 9/26/01
5 // Copyright (C) MicroStrategy Incorporated 2001
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MBase_ReferenceCounted_h
9 #define MBase_ReferenceCounted_h
10 
11 #ifdef _MSC_VER
12 #pragma warning(disable:4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
13 #endif
14 
15 namespace MBase
16 {
17  /*
18  * Derive your class from MBase::ReferenceCounted to get the standard interface
19  * of reference counting. You may get the reference counted implementation
20  * by deriving your implementation class from MSynch::ReferenceCountedImpl<>
21  * class.
22  *
23  * Example:
24  *
25  * // interface class
26  * class My:
27  * virtual public MBase::ReferenceCounted
28  * {
29  * ...
30  * }
31  *
32  * // implementation class
33  * class MyImpl:
34  * public My,
35  * virtual public MSynch::ReferenceCountedImpl<>
36  *
37  * {
38  * ...
39  * }
40  *
41  * If MyImpl is a single-threaded class, you may save a link dependency to Synch
42  * by using a simple integer instead of an MSynch::AtomicLong (default template
43  * parameter of MSynch::ReferenceCountedImpl)
44  *
45  * Example:
46  *
47  * // implementation class (single-threaded!)
48  * class MyImpl:
49  * public My,
50  * virtual public MSynch::ReferenceCountedImpl<int>
51  *
52  * {
53  * ...
54  * }
55  *
56  * @see MSynch::ReferenceCountedImpl
57  */
59  {
60  protected:
61 
62  virtual ~ReferenceCounted() throw()
63  {
64  };
65 
66  public:
67  virtual void AddRef() const throw()=0;
68  virtual void Release() const throw()=0;
69  };
70 }
71 
72 #endif // MBase_ReferenceCounted_h
virtual void Release() const =0
Definition: Allocator.h:47
virtual ~ReferenceCounted()
Definition: ReferenceCounted.h:62
Definition: ReferenceCounted.h:58
virtual void AddRef() const =0