|
Interface Technology Basics
VST 3.6.6
SDK for developing VST Plug-in
|
OPtr - "owning" smart pointer used for newly created FObjects. More...
#include <smartpointer.h>
Inheritance diagram for OPtr< I >:Public Member Functions | |
| OPtr (I *p) | |
| OPtr (const IPtr< I > &p) | |
| OPtr (const OPtr< I > &p) | |
| OPtr () | |
| I * | operator= (I *_ptr) |
Public Member Functions inherited from IPtr< I > | |
| IPtr (I *ptr, bool addRef=true) | |
| IPtr (const IPtr &) | |
| IPtr (const IPtr< I > &other) | |
| IPtr () | |
| ~IPtr () | |
| I * | operator= (I *ptr) |
| IPtr & | operator= (const IPtr &other) |
| IPtr & | operator= (const IPtr< I > &other) |
| operator I * () const | |
| I * | operator-> () const |
| I * | get () const |
Additional Inherited Members | |
Protected Attributes inherited from IPtr< I > | |
| I * | ptr |
OPtr - "owning" smart pointer used for newly created FObjects.
FUnknown implementations are supposed to have a refCount of 1 right after creation. So using an IPtr on newly created objects would lead to a leak. Instead the OPtr can be used in this case.
Example:
The assignment operator takes ownership of a new object and releases the old. So its safe to write:
This is the difference to using an IPtr with addRef=false.
This will lead to a leak!
|
inline |
|
inline |
|
inline |