18template<
class GetCategory>
21 if (_ptr ==
nullptr) {
22 _ptr = GetCategory::get_category();
33template<
class GetCategory>
36 nassertd(_ptr !=
nullptr) {
38 nout <<
"Uninitialized notify proxy: " << _ptr->get_fullname() <<
"\n";
50template<
class GetCategory>
59template<
class GetCategory>
61is_on(NotifySeverity severity) {
62 return get_unsafe_ptr()->
is_on(severity);
68template<
class GetCategory>
73 return UNLIKELY(get_unsafe_ptr()->is_spam());
82template<
class GetCategory>
87 return UNLIKELY(get_unsafe_ptr()->is_debug());
96template<
class GetCategory>
99 return get_unsafe_ptr()->
is_info();
105template<
class GetCategory>
114template<
class GetCategory>
117 return get_unsafe_ptr()->
is_error();
123template<
class GetCategory>
126 return get_unsafe_ptr()->
is_fatal();
132template<
class GetCategory>
134out(NotifySeverity severity,
bool prefix) {
135 return get_unsafe_ptr()->
out(severity, prefix);
141template<
class GetCategory>
144 return get_unsafe_ptr()->
spam(prefix);
150template<
class GetCategory>
153 return get_unsafe_ptr()->
debug(prefix);
159template<
class GetCategory>
162 return get_unsafe_ptr()->
info(prefix);
168template<
class GetCategory>
171 return get_unsafe_ptr()->
warning(prefix);
177template<
class GetCategory>
180 return get_unsafe_ptr()->
error(prefix);
186template<
class GetCategory>
189 return get_unsafe_ptr()->
fatal(prefix);
198template<
class GetCategory>
201 return get_safe_ptr();
209template<
class GetCategory>
212 return *get_safe_ptr();
220template<
class GetCategory>
223 return get_safe_ptr();
A handy wrapper around a NotifyCategory pointer.
NotifyCategory & operator*()
This operator handles the case of dereferencing the proxy object as if it were a pointer,...
NotifyCategory * get_unsafe_ptr()
Returns a pointer which is assumed to have been already initialized.
NotifyCategory * init()
Initializes the proxy object by calling get_category() on the template class.
NotifyCategory * get_safe_ptr()
Returns a pointer which is *not* assumed to have been already initialized; if necessary,...
NotifyCategory * operator->()
This magic operator function defines the syntax proxy->info(), etc., for all of the methods that are ...
A particular category of error messages.
std::ostream & fatal(bool prefix=true) const
A shorthand way to write out(NS_fatal).
bool is_error() const
A shorthand way to write is_on(NS_error).
bool is_on(NotifySeverity severity) const
Returns true if messages of the indicated severity level ought to be reported for this Category.
std::ostream & debug(bool prefix=true) const
A shorthand way to write out(NS_debug).
std::ostream & info(bool prefix=true) const
A shorthand way to write out(NS_info).
std::ostream & out(NotifySeverity severity, bool prefix=true) const
Begins a new message to this Category at the indicated severity level.
std::ostream & spam(bool prefix=true) const
A shorthand way to write out(NS_spam).
std::ostream & warning(bool prefix=true) const
A shorthand way to write out(NS_warning).
bool is_info() const
A shorthand way to write is_on(NS_info).
std::ostream & error(bool prefix=true) const
A shorthand way to write out(NS_error).
bool is_fatal() const
A shorthand way to write is_on(NS_fatal).
bool is_warning() const
A shorthand way to write is_on(NS_warning).