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
Data Structures | Namespaces | Macros | Typedefs | Enumerations
finitializer.h File Reference

Global Initialization / Termination Mechanism. More...

#include "pluginterfaces/base/ftypes.h"

Data Structures

class  OneTimeProcedure
 Manager for initialization & termination code. More...
 

Namespaces

 Steinberg
 

Macros

#define INIT_FUNCTION_NAME(name)   init##name
 Get a classes initialization procedure name. More...
 
#define INIT_FUNCTION(name)   bool INIT_FUNCTION_NAME(name) ()
 Use this to call an initialization procedure directly. More...
 
#define TERM_FUNCTION_NAME(name)   term##name
 Get a classes termination procedure name. More...
 
#define TERM_FUNCTION(name)   bool TERM_FUNCTION_NAME(name) ()
 Use this to call a termination procedure directly. Be aware that this does not unregister the procedure. It will be executed again, if terminate () is called ! More...
 
#define INITIALIZE(name)
 Use this to register any initialization code. More...
 
#define INITIALIZE_LEVEL(name, level)
 Same as INITIALIZE(name), but utilizes initialization levels (see enum InitLevel). More...
 
#define TERMINATE(name)
 Use this to register any termination. More...
 
#define TERMINATE_LEVEL(name, level)
 Same as TERMINATE(name), but utilizes levels (see enum InitLevel). More...
 
#define FRIEND_INITIALIZE(name)   friend INIT_FUNCTION(name);
 
#define FRIEND_TERMINATE(name)   friend TERM_FUNCTION(name);
 
#define PRE_INITIALIZE(name)   INITIALIZE_LEVEL(name, kInitLevelFirst)
 
#define POST_INITIALIZE(name)   INITIALIZE_LEVEL(name, kInitLevelLast)
 

Typedefs

typedef bool(* InitTermFunc )()
 Initialization / Termination procedure format. There must not be parameters. Return true to indicate execution success. An initialization procedure returning false causes immediate initialization abort. More...
 

Enumerations

enum  InitLevel {
  kInitLevelFirst = 0, kInitLevelBelowStd = 25, kInitLevelStd = 50, kInitLevelAboveStd = 75,
  kInitLevelLast = 100
}
 With init levels, you may initialize things in different places / at different program startup stages. More...
 

Detailed Description

Global Initialization / Termination Mechanism.

Macro Definition Documentation

#define INIT_FUNCTION_NAME (   name)    init##name

Get a classes initialization procedure name.

#define INIT_FUNCTION (   name)    bool INIT_FUNCTION_NAME(name) ()

Use this to call an initialization procedure directly.

Be aware that this does not unregister the procedure. It will be executed again, if terminate () is called !

#define TERM_FUNCTION_NAME (   name)    term##name

Get a classes termination procedure name.

#define TERM_FUNCTION (   name)    bool TERM_FUNCTION_NAME(name) ()

Use this to call a termination procedure directly. Be aware that this does not unregister the procedure. It will be executed again, if terminate () is called !

#define INITIALIZE (   name)
Value:
INIT_FUNCTION(name); \
::Steinberg::OneTimeProcedure name##Initializer (true, INIT_FUNCTION_NAME(name), #name); \
#define INIT_FUNCTION_NAME(name)
Get a classes initialization procedure name.
Definition: finitializer.h:95
Manager for initialization & termination code.
Definition: finitializer.h:70
#define INIT_FUNCTION(name)
Use this to call an initialization procedure directly.
Definition: finitializer.h:101

Use this to register any initialization code.

The name parameter must be unique in the code (for example a class name). Example:

INITIALIZE (MyViewController)
{
globalViewControllerRegistry->registerViewController(MyViewController::ClassId);
}
#define INITIALIZE_LEVEL (   name,
  level 
)
Value:
INIT_FUNCTION(name); \
::Steinberg::OneTimeProcedure name##Initializer (true, INIT_FUNCTION_NAME(name), #name, level); \
bool init##name ()
#define INIT_FUNCTION_NAME(name)
Get a classes initialization procedure name.
Definition: finitializer.h:95
Manager for initialization & termination code.
Definition: finitializer.h:70
#define INIT_FUNCTION(name)
Use this to call an initialization procedure directly.
Definition: finitializer.h:101

Same as INITIALIZE(name), but utilizes initialization levels (see enum InitLevel).

#define TERMINATE (   name)
Value:
TERM_FUNCTION(name); \
::Steinberg::OneTimeProcedure name##Terminator (false, TERM_FUNCTION_NAME(name), #name); \
Manager for initialization & termination code.
Definition: finitializer.h:70
#define TERM_FUNCTION_NAME(name)
Get a classes termination procedure name.
Definition: finitializer.h:103
#define TERM_FUNCTION(name)
Use this to call a termination procedure directly. Be aware that this does not unregister the procedu...
Definition: finitializer.h:104

Use this to register any termination.

The name parameter must be unique in the code. Example:

TERMINATE(MyViewController)
{
globalViewControllerRegistry->unregisterViewController(MyViewController::ClassId);
}
#define TERMINATE_LEVEL (   name,
  level 
)
Value:
TERM_FUNCTION(name); \
::Steinberg::OneTimeProcedure name##Terminator (false, TERM_FUNCTION_NAME(name), #name, level); \
Manager for initialization & termination code.
Definition: finitializer.h:70
#define TERM_FUNCTION_NAME(name)
Get a classes termination procedure name.
Definition: finitializer.h:103
#define TERM_FUNCTION(name)
Use this to call a termination procedure directly. Be aware that this does not unregister the procedu...
Definition: finitializer.h:104

Same as TERMINATE(name), but utilizes levels (see enum InitLevel).

#define FRIEND_INITIALIZE (   name)    friend INIT_FUNCTION(name);
#define FRIEND_TERMINATE (   name)    friend TERM_FUNCTION(name);
#define PRE_INITIALIZE (   name)    INITIALIZE_LEVEL(name, kInitLevelFirst)
#define POST_INITIALIZE (   name)    INITIALIZE_LEVEL(name, kInitLevelLast)
Empty

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