OpenSceneGraph 3.6.5
Notify
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_NOTIFY_H
15#define OSG_NOTIFY_H 1
16
17#include <osg/Export>
18#include <osg/Referenced> // for NotifyHandler
19
20#include <ostream>
21
22namespace osg {
23
39
44
47
50
51#ifdef OSG_NOTIFY_DISABLED
52 inline bool isNotifyEnabled(NotifySeverity) { return false; }
53#else
56#endif
57
78extern OSG_EXPORT std::ostream& notify(const NotifySeverity severity);
79
80inline std::ostream& notify(void) { return notify(osg::INFO); }
81
82#define OSG_NOTIFY(level) if (osg::isNotifyEnabled(level)) osg::notify(level)
83#define OSG_ALWAYS OSG_NOTIFY(osg::ALWAYS)
84#define OSG_FATAL OSG_NOTIFY(osg::FATAL)
85#define OSG_WARN OSG_NOTIFY(osg::WARN)
86#define OSG_NOTICE OSG_NOTIFY(osg::NOTICE)
87#define OSG_INFO OSG_NOTIFY(osg::INFO)
88#define OSG_DEBUG OSG_NOTIFY(osg::DEBUG_INFO)
89#define OSG_DEBUG_FP OSG_NOTIFY(osg::DEBUG_FP)
90
105{
106public:
107 virtual void notify(osg::NotifySeverity severity, const char *message) = 0;
108};
109
114
117
124{
125public:
126 void notify(osg::NotifySeverity severity, const char *message);
127};
128
129#if defined(WIN32) && !defined(__CYGWIN__)
130
135class OSG_EXPORT WinDebugNotifyHandler : public NotifyHandler
136{
137public:
138 void notify(osg::NotifySeverity severity, const char *message);
139};
140
141#endif
142
143}
144
145#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
NotifySeverity
Range of notify levels from DEBUG_FP through to FATAL, ALWAYS is reserved for forcing the absorption ...
Definition Notify:30
@ WARN
Definition Notify:33
@ DEBUG_INFO
Definition Notify:36
@ NOTICE
Definition Notify:34
@ INFO
Definition Notify:35
@ FATAL
Definition Notify:32
@ DEBUG_FP
Definition Notify:37
@ ALWAYS
Definition Notify:31
OSG_EXPORT bool isNotifyEnabled(NotifySeverity severity)
is notification enabled, given the current setNotifyLevel() setting?
OSG_EXPORT bool initNotifyLevel()
initialize notify level.
OSG_EXPORT void setNotifyHandler(NotifyHandler *handler)
Set notification handler, by default StandardNotifyHandler is used.
OSG_EXPORT NotifyHandler * getNotifyHandler()
Get currrent notification handler.
OSG_EXPORT NotifySeverity getNotifyLevel()
get the notify level.
std::ostream & notify(void)
Definition Notify:80
OSG_EXPORT void setNotifyLevel(NotifySeverity severity)
set the notify level, overriding the default or the value set by the environmental variable OSGNOTIFY...
OSG_EXPORT std::ostream & notify(const NotifySeverity severity)
notify messaging function for providing fatal through to verbose debugging messages.
Handler processing output of notification stream.
Definition Notify:105
virtual void notify(osg::NotifySeverity severity, const char *message)=0
Redirects notification stream to stderr (severity <= WARN) or stdout (severity > WARN).
Definition Notify:124
void notify(osg::NotifySeverity severity, const char *message)
Base class for providing reference counted objects.
Definition Referenced:44
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.