• R/O
  • SSH
  • HTTPS

globalbase: Commit


Commit MetaInfo

Revision5957 (tree)
Time2019-01-18 17:17:50
Authorjoshua

Log Message

sPtr

Change Summary

Incremental Difference

--- modules/tinyState/trunk/src/h/ts/c++/sPtr.h (revision 5956)
+++ modules/tinyState/trunk/src/h/ts/c++/sPtr.h (revision 5957)
@@ -10,35 +10,35 @@
1010 class sPtr : public sObject {
1111 public:
1212 sPtr() {
13- _ptr = 0;
13+ ptr = 0;
1414 }
1515 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();
1919 if ( mutex_flag )
2020 stdObject::refUnlock();
2121 }
2222 sPtr(const sPtr & inp) {
2323 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();
2929 stdObject::refUnlock();
3030 }
3131 ~sPtr() {
32- if ( _ptr )
33- _ptr->relref();
32+ if ( ptr )
33+ ptr->relref();
3434 }
3535 sPtr& operator=(sPtr inp) {
3636 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();
4242 stdObject::refUnlock();
4343 return *this;
4444 }
@@ -45,26 +45,23 @@
4545 sPtr& operator=(int inp) {
4646 if ( inp )
4747 stdObject::panic("sPtr not ZERO");
48- if ( _ptr )
49- _ptr->relref();
50- _ptr = 0;
48+ if ( ptr )
49+ ptr->relref();
50+ ptr = 0;
5151 return *this;
5252 }
5353 int operator==(sPtr inp) {
54- return (_ptr == inp.get());
54+ return (ptr == inp.ptr);
5555 }
5656 int operator!=(sPtr inp) {
57- return (_ptr != inp.get());
57+ return (ptr != inp.ptr);
5858 }
5959
60- __TYPE * get() const {
61- return _ptr;
62- }
6360 __TYPE * operator->() const {
64- return _ptr;
61+ return ptr;
6562 }
6663 protected:
67- __TYPE * _ptr;
64+ __TYPE * ptr;
6865 };
6966
7067
Show on old repository browser