Base Module VST 3.7 SDK for developing VST plug-in

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
FBooleanSetter< T > Struct Template Reference

Class definition for objects that help resetting boolean variables. More...

`#include <fcleanup.h>`

## Public Member Functions
| FBooleanSetter (T &_toSet)
| Constructor.
| ~FBooleanSetter ()
| Destructor. Resets the at construction time passed boolean to FALSE.

## Public Attributes
T & | toSet
| Remembers the boolean that is to be reset during destruction.

## Detailed Description

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

Class definition for objects that help resetting boolean variables.

A stack allocated object of this type automatically sets an at construction time passed boolean variable immediately to TRUE and resets the same variable to FALSE when it reaches the end of its own scope.
Intended usage:

bool theBoolean = false;
{
Steinberg::FBoolSetter theBoolSetter (theBoolean);
// Here the constructor of theBoolSetter sets theBoolean to TRUE.
// Do something.
} // Here the destructor of theBoolSetter resets theBoolean to FALSE.
Steinberg::FBoolSetter
FBooleanSetter< bool > FBoolSetter
Definition fcleanup.h:190

## Constructor & Destructor Documentation

## ◆ FBooleanSetter()

template<class T>

FBooleanSetter | ( | T & | _toSet | ) |
| inline

Constructor.

_toSet is a reference to the boolean that is set to TRUE immediately in this constructor call and gets reset to FALSE when this FBoolSetter object's destructor is executed.

## ◆ ~FBooleanSetter()

template<class T>

~FBooleanSetter | ( |  | ) |
| inline

Destructor. Resets the at construction time passed boolean to FALSE.

## Member Data Documentation

## ◆ toSet

template<class T>

T& toSet

Remembers the boolean that is to be reset during destruction.

Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.