30 template<
typename EType>
39 template<
typename EType>
70 operator EType*()
const {
return ptr; }
88 EType*
release(){ EType* tmp=ptr; ptr=
nullptr;
return tmp; }
91 FXAutoPtr&
reset(EType* p=
nullptr){
if(p!=ptr){
delete ptr; ptr=p; }
return *
this; }
99 template <
typename EType> FXStream& operator<<(FXStream& store,const FXAutoPtr<EType>& obj){
100 EType *temp=obj; store << temp;
return store;
105 template <
typename EType> FXStream& operator>>(FXStream& store,FXAutoPtr<EType>& obj){
106 EType *temp; store >> temp; obj=temp;
return store;
FXAutoPtr & operator=(FXAutoPtr< T > &src)
Assign from an automatic pointer with compatible type.
Definition: FXAutoPtr.h:67
Implicitly used FXAutoPtrRef to hand FXAutoPtr through implicitly called constructors and conversion ...
Definition: FXAutoPtr.h:31
FXAutoPtr & operator=(EType *src)
Assign from pointer.
Definition: FXAutoPtr.h:58
~FXAutoPtr()
Destruction deletes pointer.
Definition: FXAutoPtr.h:94
FXAutoPtr(FXAutoPtr< EType > &src)
Construct from another automatic pointer.
Definition: FXAutoPtr.h:49
FXAutoPtr(FXAutoPtr< T > &src)
Construct from another automatic pointer of compatible type.
Definition: FXAutoPtr.h:55
FXAutoPtr & reset(EType *p=nullptr)
Delete old object, replace by new, if any.
Definition: FXAutoPtr.h:91
FXAutoPtr(FXAutoPtrRef< EType > src)
Construct from FXAutoPtrRef.
Definition: FXAutoPtr.h:52
FXAutoPtr & operator=(FXAutoPtr< EType > &src)
Assign from an another automatic pointer.
Definition: FXAutoPtr.h:61
EType * release()
Release hold on the pointer.
Definition: FXAutoPtr.h:88
Definition: FX4Splitter.h:28
Automatic pointer.
Definition: FXAutoPtr.h:40
FXAutoPtr & operator=(FXAutoPtrRef< EType > src)
Assign from FXAutoPtrRef.
Definition: FXAutoPtr.h:64
EType & operator*() const
Dereference operator.
Definition: FXAutoPtr.h:79
EType * operator->() const
Follow pointer operator.
Definition: FXAutoPtr.h:82
EType & operator[](FXival i) const
Array indexing.
Definition: FXAutoPtr.h:85
FXAutoPtr(EType *src=nullptr)
Construct from optional pointer.
Definition: FXAutoPtr.h:46