Introduced NOTIFY macro to help out with avoiding using of streams with notification level is below the user defined cutoff. This addition has been introduced to help out with avoid threading performance issues with the Microsoft ostream implementation.

This commit is contained in:
Robert Osfield 2010-02-09 17:39:43 +00:00
parent be46c61eb1
commit 5792bc6d99

View File

@ -75,6 +75,15 @@ extern OSG_EXPORT std::ostream& notify(const NotifySeverity severity);
inline std::ostream& notify(void) { return notify(osg::INFO); }
#define NOTIFY(level) if (level>isNotifyEnabled(level)) osg::notify(level)
#if _DEBUG
#define DEBUG_NOTIFY(level) if (level>isNotifyEnabled(level)) osg::notify(level)
#else
// when using an optimized build use if (false) to tell the compiler to ignore the rest of the notify.
#define DEBUG_NOTIFY(level) if (false) osg::notify(level)
#endif
/** Handler processing output of notification stream. It acts as a sink to
* notification messages. It is called when notification stream needs to be
* synchronized (i.e. after osg::notify() << std::endl).