GlobalReferenceMaker::GlobalReferenceDisableGuard Class Reference


Detailed Description

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>

Inheritance diagram for GlobalReferenceMaker::GlobalReferenceDisableGuard:
Inheritance graph
[legend]

List of all members.

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.

Constructor & Destructor Documentation

CoreExport GlobalReferenceDisableGuard ( bool  doDisable = true )

Constructor; disables global reference makers.

A boolean parameter may be used to conditionally have this class do nothing.

Parameters:
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.


Member Function Documentation

static CoreExport bool IsDisabled ( ) [static]

Determines whether global reference makers are currently disabled.

Returns:
true if global reference makers are disabled; false otherwise.

GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard
GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard GlobalReferenceMaker::GlobalReferenceDisableGuard