Base Module VST 3.6.11 SDK for developing VST Plug-in

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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.

## Constructor & Destructor Documentation

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

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

## Member Data Documentation

T& toSet

Remembers the boolean that is to be reset during destruction.

Empty

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