PrevNextUpHome BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1

20.2. Smart Pointer

If using the smart pointer, you don't have to manage the reference counter, and also the interfaces that are no longer used will be automatically released.

Example 20.5. How to use the smart pointer

// SFBHashSmp is smart pointer for SFBHash interface
// create new interface using SFBHash::NewInstance function
SFBHashSmp hash(SFBHash::NewInstance(AEECLSID_MD5));

// call API
hash->Restart();

// interface that is no longer used will be automatically released