Base Module  VST 3.6.6
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Data Fields
FCloser< T > Struct Template Reference

Template definition for classes that help closing resourses. More...

#include <fcleanup.h>

Public Member Functions

 FCloser (T *_obj)
 Constructor. _obj is the pointer on which close is to be called when this FCloser object's destructor is executed. More...
 
 ~FCloser ()
 Destructor. Calls the close function on the at construction time passed pointer. More...
 

Data Fields

T * obj
 Remembers the pointer on which close is to be called during destruction. More...
 

Detailed Description

template<class T>
struct Steinberg::FCloser< T >

Template definition for classes that help closing resourses.

A stack allocated object of this type autonomically calls the close method of an at construction time passed object when it reaches the end of its scope. It goes without saying that the given type needs to have a close method.

Intended usage:

struct CloseableObject
{
void close() {};
};
{
CloseableObject theObject;
Steinberg::FCloser<CloseableObject> theCloser (&theObject);
// Do something.
} // Here the destructor of theCloser calls the close method of theObject.

Constructor & Destructor Documentation

FCloser ( T *  _obj)
inline

Constructor. _obj is the pointer on which close is to be called when this FCloser object's destructor is executed.

~FCloser ( )
inline

Destructor. Calls the close function on the at construction time passed pointer.

Field Documentation

T* obj

Remembers the pointer on which close is to be called during destruction.

Empty

Copyright ©2016 Steinberg Media Technologies GmbH. All Rights Reserved.