sPtr
@@ -10,35 +10,35 @@ | ||
10 | 10 | class sPtr : public sObject { |
11 | 11 | public: |
12 | 12 | sPtr() { |
13 | - _ptr = 0; | |
13 | + ptr = 0; | |
14 | 14 | } |
15 | 15 | sPtr(__TYPE * org,int mutex_flag=0) { |
16 | - _ptr = org; | |
17 | - if ( _ptr ) | |
18 | - _ptr->addref(); | |
16 | + ptr = org; | |
17 | + if ( ptr ) | |
18 | + ptr->addref(); | |
19 | 19 | if ( mutex_flag ) |
20 | 20 | stdObject::refUnlock(); |
21 | 21 | } |
22 | 22 | sPtr(const sPtr & inp) { |
23 | 23 | stdObject::refLock(); |
24 | - if ( _ptr ) | |
25 | - _ptr->relref(); | |
26 | - _ptr = inp.get(); | |
27 | - if ( _ptr ) | |
28 | - _ptr->addref(); | |
24 | + if ( ptr ) | |
25 | + ptr->relref(); | |
26 | + ptr = inp.ptr; | |
27 | + if ( ptr ) | |
28 | + ptr->addref(); | |
29 | 29 | stdObject::refUnlock(); |
30 | 30 | } |
31 | 31 | ~sPtr() { |
32 | - if ( _ptr ) | |
33 | - _ptr->relref(); | |
32 | + if ( ptr ) | |
33 | + ptr->relref(); | |
34 | 34 | } |
35 | 35 | sPtr& operator=(sPtr inp) { |
36 | 36 | stdObject::refLock(); |
37 | - if ( _ptr ) | |
38 | - _ptr->relref(); | |
39 | - _ptr = inp.get(); | |
40 | - if ( _ptr ) | |
41 | - _ptr->addref(); | |
37 | + if ( ptr ) | |
38 | + ptr->relref(); | |
39 | + ptr = inp.ptr; | |
40 | + if ( ptr ) | |
41 | + ptr->addref(); | |
42 | 42 | stdObject::refUnlock(); |
43 | 43 | return *this; |
44 | 44 | } |
@@ -45,26 +45,23 @@ | ||
45 | 45 | sPtr& operator=(int inp) { |
46 | 46 | if ( inp ) |
47 | 47 | stdObject::panic("sPtr not ZERO"); |
48 | - if ( _ptr ) | |
49 | - _ptr->relref(); | |
50 | - _ptr = 0; | |
48 | + if ( ptr ) | |
49 | + ptr->relref(); | |
50 | + ptr = 0; | |
51 | 51 | return *this; |
52 | 52 | } |
53 | 53 | int operator==(sPtr inp) { |
54 | - return (_ptr == inp.get()); | |
54 | + return (ptr == inp.ptr); | |
55 | 55 | } |
56 | 56 | int operator!=(sPtr inp) { |
57 | - return (_ptr != inp.get()); | |
57 | + return (ptr != inp.ptr); | |
58 | 58 | } |
59 | 59 | |
60 | - __TYPE * get() const { | |
61 | - return _ptr; | |
62 | - } | |
63 | 60 | __TYPE * operator->() const { |
64 | - return _ptr; | |
61 | + return ptr; | |
65 | 62 | } |
66 | 63 | protected: |
67 | - __TYPE * _ptr; | |
64 | + __TYPE * ptr; | |
68 | 65 | }; |
69 | 66 | |
70 | 67 |