AGX Dynamics  2.37.2.0
Initializer.h File Reference
#include <agx/agx.h>
#include <agx/Integer.h>
#include <agx/Callback.h>

Go to the source code of this file.

Classes

class  agx::InitCallback
 Do not use class directly. Use AGX_INIT_CALLBACK instead. More...
 
class  agx::ShutdownCallback
 
class  agx::StaticInitializer
 
class  agx::StaticShutdown
 

Namespaces

 agx
 The agx namespace contains the dynamics/math part of the AGX Dynamics API.
 

Macros

#define AGX_INIT_CALLBACK()
 Register a function to be called on all subsequent executions of agx::init(). More...
 
#define AGX_SHUTDOWN_CALLBACK()
 AGX_SHUTDOWN_CALLBACK is used to run code when agx::shutdown is called. More...
 
#define AGX_STATIC_INITIALIZER()
 AGX_STATIC_INITIALIZER is used to run code statically as agx is loaded. More...
 
#define AGX_STATIC_SHUTDOWN()
 

Macro Definition Documentation

◆ AGX_INIT_CALLBACK

#define AGX_INIT_CALLBACK ( )
Value:
static void AGX_CONCAT(__agx_init_callback, __LINE__)(); \
static agx::InitCallback AGX_CONCAT(__agx_init_callback_dispatch, __LINE__)(&AGX_CONCAT(__agx_init_callback, __LINE__)); \
static void AGX_CONCAT(__agx_init_callback, __LINE__)()
#define AGX_CONCAT(x, y)
Definition: Object.h:40
Do not use class directly. Use AGX_INIT_CALLBACK instead.
Definition: Initializer.h:80

Register a function to be called on all subsequent executions of agx::init().

If AGX is currently initialized, then the provided function is called immediately.

Definition at line 74 of file Initializer.h.

◆ AGX_SHUTDOWN_CALLBACK

#define AGX_SHUTDOWN_CALLBACK ( )
Value:
static void AGX_CONCAT(__agx_shutdown_callback, __LINE__)(void); \
static agx::ShutdownCallback AGX_CONCAT(__agx_shutdown_callback_dispatch, __LINE__)(&AGX_CONCAT(__agx_shutdown_callback, __LINE__)); \
static void AGX_CONCAT(__agx_shutdown_callback, __LINE__)(void)
#define AGX_CONCAT(x, y)
Definition: Object.h:40

AGX_SHUTDOWN_CALLBACK is used to run code when agx::shutdown is called.

Note the difference to AGX_SHUTDOWN_CALLBACK, which is only called once when the agx library is unloaded, agx::shutdown on the other hand can be called many times. Example usage:

AGX_SHUTDOWN_CALLBACK() { printf("agx::shutdown called!\n"); }

Definition at line 108 of file Initializer.h.

◆ AGX_STATIC_INITIALIZER

#define AGX_STATIC_INITIALIZER ( )
Value:
static void AGX_CONCAT(__agx_static_init, __LINE__)(void); \
static agx::StaticInitializer AGX_CONCAT(__agx_static_init_dispatch, __LINE__)(&AGX_CONCAT(__agx_static_init, __LINE__)); \
static void AGX_CONCAT(__agx_static_init, __LINE__)(void)
#define AGX_CONCAT(x, y)
Definition: Object.h:40

AGX_STATIC_INITIALIZER is used to run code statically as agx is loaded.

Normally before main is entered. Example usage:

AGX_STATIC_INITIALIZER() { printf("Init!"); }

Definition at line 34 of file Initializer.h.

◆ AGX_STATIC_SHUTDOWN

#define AGX_STATIC_SHUTDOWN ( )
Value:
static void AGX_CONCAT(__agx_static_shutdown, __LINE__)(void); \
static agx::StaticShutdown AGX_CONCAT(__agx_static_shutdown_dispatch, __LINE__)(&AGX_CONCAT(__agx_static_shutdown, __LINE__)); \
static void AGX_CONCAT(__agx_static_shutdown, __LINE__)(void)
#define AGX_CONCAT(x, y)
Definition: Object.h:40

Definition at line 50 of file Initializer.h.