Notify
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_NOTIFY_H
#define OSG_NOTIFY_H 1
#include <osg/Export>
#include <osg/Referenced> // for NotifyHandler
#include <ostream>
namespace osg {
enum NotifySeverity {
ALWAYS=0,
FATAL=1,
WARN=2,
NOTICE=3,
INFO=4,
DEBUG_INFO=5,
DEBUG_FP=6
};
extern OSG_EXPORT void setNotifyLevel(NotifySeverity severity);
extern OSG_EXPORT NotifySeverity getNotifyLevel();
extern OSG_EXPORT bool initNotifyLevel();
#ifdef OSG_NOTIFY_DISABLED
inline bool isNotifyEnabled(NotifySeverity) { return false; }
#else
extern OSG_EXPORT bool isNotifyEnabled(NotifySeverity severity);
#endif
extern OSG_EXPORT std::ostream& notify(const NotifySeverity severity);
inline std::ostream& notify(void) { return notify(osg::INFO); }
#define OSG_NOTIFY(level) if (osg::isNotifyEnabled(level)) osg::notify(level)
#define OSG_ALWAYS OSG_NOTIFY(osg::ALWAYS)
#define OSG_FATAL OSG_NOTIFY(osg::FATAL)
#define OSG_WARN OSG_NOTIFY(osg::WARN)
#define OSG_NOTICE OSG_NOTIFY(osg::NOTICE)
#define OSG_INFO OSG_NOTIFY(osg::INFO)
#define OSG_DEBUG OSG_NOTIFY(osg::DEBUG_INFO)
#define OSG_DEBUG_FP OSG_NOTIFY(osg::DEBUG_FP)
class OSG_EXPORT NotifyHandler : public osg::Referenced
{
public:
virtual void notify(osg::NotifySeverity severity, const char *message) = 0;
};
extern OSG_EXPORT void setNotifyHandler(NotifyHandler *handler);
extern OSG_EXPORT NotifyHandler *getNotifyHandler();
class OSG_EXPORT StandardNotifyHandler : public NotifyHandler
{
public:
void notify(osg::NotifySeverity severity, const char *message);
};
#if defined(WIN32) && !defined(__CYGWIN__)
class OSG_EXPORT WinDebugNotifyHandler : public NotifyHandler
{
public:
void notify(osg::NotifySeverity severity, const char *message);
};
#endif
}
#endif
Referenced
osg::NotifyHandler
Definition Notify:105
osg::NotifyHandler::notify
virtual void notify(osg::NotifySeverity severity, const char *message)=0
osg::Referenced
Definition Referenced:44
osg::StandardNotifyHandler
Definition Notify:124
osg::StandardNotifyHandler::notify
void notify(osg::NotifySeverity severity, const char *message)
osg
Definition AlphaFunc:19
osg::NotifySeverity
NotifySeverity
Definition Notify:30
osg::WARN
@ WARN
Definition Notify:33
osg::DEBUG_INFO
@ DEBUG_INFO
Definition Notify:36
osg::NOTICE
@ NOTICE
Definition Notify:34
osg::INFO
@ INFO
Definition Notify:35
osg::FATAL
@ FATAL
Definition Notify:32
osg::DEBUG_FP
@ DEBUG_FP
Definition Notify:37
osg::ALWAYS
@ ALWAYS
Definition Notify:31
osg::isNotifyEnabled
OSG_EXPORT bool isNotifyEnabled(NotifySeverity severity)
osg::initNotifyLevel
OSG_EXPORT bool initNotifyLevel()
osg::setNotifyHandler
OSG_EXPORT void setNotifyHandler(NotifyHandler *handler)
osg::getNotifyHandler
OSG_EXPORT NotifyHandler * getNotifyHandler()
osg::getNotifyLevel
OSG_EXPORT NotifySeverity getNotifyLevel()
osg::notify
std::ostream & notify(void)
Definition Notify:80
osg::setNotifyLevel
OSG_EXPORT void setNotifyLevel(NotifySeverity severity)
osg::notify
OSG_EXPORT std::ostream & notify(const NotifySeverity severity)
Export
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39