This class is used to temporarily disable global reference makers.
Implements the guard pattern to disable global reference makers.
While disabled, none of the reference messages are sent to the
global reference makers that were registered through
RegisterGlobalReference().
The class correctly handles nested disables by using a counter
which is incremented in the constructor and decremented in the
destructor.
An example of a case where it is useful to disable global reference
makers is an operation which creates a lot of temporary references,
such as temporary materials. The global reference makers may not
need to be aware of the existence of these temporary references, so
they may be disabled for performance reasons.
#include <ref.h>
Public Member Functions |
|
CoreExport | GlobalReferenceDisableGuard (bool doDisable=true) |
Constructor; disables global reference
makers. |
|
CoreExport | ~GlobalReferenceDisableGuard () |
Destructor; re-enables global reference
makers. |
|
Static Public Member Functions |
|
static CoreExport bool | IsDisabled () |
Determines whether global reference makers
are currently disabled. |
CoreExport GlobalReferenceDisableGuard | ( | bool | doDisable = true |
) |
Constructor; disables global reference makers.
A boolean parameter may be used to conditionally have this class do nothing.
doDisable | - When true, this class will disable the global reference makers. When false, this class does nothing. |
CoreExport ~GlobalReferenceDisableGuard | ( | ) |
Destructor; re-enables global reference makers.
Global reference makers are only re-enabled if they were disabled in the constructor.
static CoreExport bool IsDisabled | ( | ) | [static] |
Determines whether global reference makers are currently disabled.