Base Module  VST 3.7
SDK for developing VST plug-in
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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.

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 ©2024 Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.