src/misc/documentPointer.h

changeset 603
47e7773c7841
parent 600
209e3f1f7b2c
child 607
353e418f161a
equal deleted inserted replaced
602:ac1744536b33 603:47e7773c7841
22 #include "../main.h" 22 #include "../main.h"
23 23
24 class LDDocument; 24 class LDDocument;
25 25
26 class LDDocumentPointer 26 class LDDocumentPointer
27 { PROPERTY (private, LDDocument*, Pointer, NO_OPS, STOCK_WRITE) 27 {
28 PROPERTY (private, LDDocument*, Pointer, NO_OPS, STOCK_WRITE)
28 29
29 public: 30 public:
30 LDDocumentPointer(); 31 LDDocumentPointer();
31 LDDocumentPointer (LDDocument* ptr); 32 LDDocumentPointer (LDDocument* ptr);
32 LDDocumentPointer (const LDDocumentPointer& other); 33 LDDocumentPointer (const LDDocumentPointer& other);
33 ~LDDocumentPointer(); 34 ~LDDocumentPointer();
34 LDDocumentPointer& operator= (LDDocument* ptr); 35 LDDocumentPointer& operator= (LDDocument* ptr);
35 36
36 LDDocumentPointer& operator= (LDDocumentPointer& other) 37 inline LDDocumentPointer& operator= (LDDocumentPointer& other)
37 { return operator= (other.getPointer()); 38 {
39 return operator= (other.getPointer());
38 } 40 }
39 41
40 LDDocument* operator->() const 42 inline LDDocument* operator->() const
41 { return getPointer(); 43 {
44 return getPointer();
42 } 45 }
43 46
44 operator LDDocument*() const 47 inline operator LDDocument*() const
45 { return getPointer(); 48 {
49 return getPointer();
46 } 50 }
47 51
48 private: 52 private:
49 void addReference(); 53 void addReference();
50 void removeReference(); 54 void removeReference();

mercurial