Base Module VST 3.7 SDK for developing VST plug-in

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. More...
| ~FBooleanSetter ()
| Destructor. Resets the at construction time passed boolean to FALSE. More...

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

## 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::FBooleanSetter
Class definition for objects that help resetting boolean variables.
Definition: fcleanup.h:179

## Constructor & Destructor Documentation

## ◆ FBooleanSetter()

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()

~FBooleanSetter | ( |  | ) |
| inline

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

## Member Data Documentation

## ◆ toSet

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.