28 template<
typename EType>
55 other.ptr=atomicSet(&ptr,other.ptr);
81 operator EType*()
const {
return ptr; }
90 operator FXbool()
const {
return !!ptr; }
102 EType*
get()
const {
return ptr; }
112 if(ptr) ptr->unref();
118 template<
typename EType> FXStream& operator<<(FXStream& store,const FXRefPtr<EType>& obj){
119 EType *temp=obj; store << temp;
return store;
124 template<
typename EType> FXStream& operator>>(FXStream& store,FXRefPtr<EType>& obj){
125 EType *temp; store >> temp; obj=temp;
return store;
FXRefPtr(EType *p)
Construct and init.
Definition: FXRefPtr.h:39
EType & operator*() const
Dereference operator.
Definition: FXRefPtr.h:84
void clear()
Clear pointer.
Definition: FXRefPtr.h:105
Pointer to shared object.
Definition: FXRefPtr.h:29
EType * operator->() const
Follow pointer operator.
Definition: FXRefPtr.h:87
FXRefPtr< EType > & operator=(EType *src)
Assignment.
Definition: FXRefPtr.h:60
Definition: FX4Splitter.h:28
FXRefPtr< EType > & swap(FXRefPtr< EType > &other)
Swap this and other, pain-free.
Definition: FXRefPtr.h:54
FXRefPtr()
Default constructor.
Definition: FXRefPtr.h:35
FXbool operator==(EType *p) const
Comparison operator.
Definition: FXRefPtr.h:96
FXbool operator!() const
Test for NULL.
Definition: FXRefPtr.h:93
FXRefPtr(FXRefPtr< T > &org)
Copy constructor from shared pointer of compatible type.
Definition: FXRefPtr.h:49
~FXRefPtr()
Destructor.
Definition: FXRefPtr.h:111
FXRefPtr< EType > & operator=(const FXRefPtr< EType > &src)
Assignment.
Definition: FXRefPtr.h:67
FXRefPtr< EType > & operator=(FXRefPtr< T > &src)
Assignment from shared pointer of compatible type.
Definition: FXRefPtr.h:74
FXbool operator!=(EType *p) const
Comparison operator.
Definition: FXRefPtr.h:99
FXRefPtr(const FXRefPtr< EType > &org)
Copy constructor.
Definition: FXRefPtr.h:44