memory/ scopedptr.bi | |
License | Copyright © 2009, FreeBASIC Extended Library Development Group |
ext | |
ScopedPtr | This class implements a pointer container similiar to boost::scoped_ptr. |
Functions | |
constuctor | This constructor takes another ScopedPtr as its argument and transfers ownership to the newly created ScopedPtr. |
constructor | This constructor takes a pointer of (type) and becomes responsible for its deletion. |
constructor | This constructor takes a pointer of (type) and will call a user passed subroutine to free the memory. |
destructor | |
Operator Let | Transfers ownership of a pointer to the lhs ScopedPtr. |
Operator Cast | Provided to allow passing a ScopedPtr(type) to a procedure requiring a (type) ptr |
Get | Provided to allow passing a ScopedPtr(type) to a procedure requiring a (type) ptr |
* (dereference) | Dereferences the (type) pointer owned by a ScopedPtr returning the value pointed to by the pointer. |
Copyright © 2009, FreeBASIC Extended Library Development Group
Distributed under the FreeBASIC Extended Library Group license. See accompanying file LICENSE.txt or copy at http://code.google.com- /p- /fb-extended-lib- /wiki- /License
This class implements a pointer container similiar to boost::scoped_ptr.
A ScopedPtr is guaranteed to be deleted when it goes out of scope.
A ScopedPtr has sole ownership of a pointer, if assigned to another ScopedPtr the new ScopedPtr will gain ownership of the pointer and the original ScopedPtr is now invalid.
Functions | |
constuctor | This constructor takes another ScopedPtr as its argument and transfers ownership to the newly created ScopedPtr. |
constructor | This constructor takes a pointer of (type) and becomes responsible for its deletion. |
constructor | This constructor takes a pointer of (type) and will call a user passed subroutine to free the memory. |
destructor | |
Operator Let | Transfers ownership of a pointer to the lhs ScopedPtr. |
Operator Cast | Provided to allow passing a ScopedPtr(type) to a procedure requiring a (type) ptr |
Get | Provided to allow passing a ScopedPtr(type) to a procedure requiring a (type) ptr |
* (dereference) | Dereferences the (type) pointer owned by a ScopedPtr returning the value pointed to by the pointer. |
This constructor takes a pointer of (type) and becomes responsible for its deletion.
declare constructor ( byval p as fbext_TypeName(T_) ptr = null )
declare destructor ( )
Provided to allow passing a ScopedPtr(type) to a procedure requiring a (type) ptr
declare function Get ( ) as fbext_TypeName(T_) ptr
Dereferences the (type) pointer owned by a ScopedPtr returning the value pointed to by the pointer.
declare operator * ( byref rhs as fbext_ScopedPtr(T_) ) as fbext_TypeName(T_)