18 template<
class GetCategory>
21 if (_ptr ==
nullptr) {
22 _ptr = GetCategory::get_category();
33 template<
class GetCategory>
36 nassertd(_ptr !=
nullptr) {
38 nout <<
"Uninitialized notify proxy: " << _ptr->get_fullname() <<
"\n";
50 template<
class GetCategory>
59 template<
class GetCategory>
61 is_on(NotifySeverity severity) {
62 return get_unsafe_ptr()->is_on(severity);
69 template<
class GetCategory>
73 return UNLIKELY(get_unsafe_ptr()->is_spam());
81 template<
class GetCategory>
85 return UNLIKELY(get_unsafe_ptr()->is_debug());
92 template<
class GetCategory>
95 return get_unsafe_ptr()->is_info();
101 template<
class GetCategory>
104 return get_unsafe_ptr()->is_warning();
110 template<
class GetCategory>
113 return get_unsafe_ptr()->is_error();
119 template<
class GetCategory>
122 return get_unsafe_ptr()->is_fatal();
128 template<
class GetCategory>
130 out(NotifySeverity severity,
bool prefix) {
131 return get_unsafe_ptr()->out(severity, prefix);
137 template<
class GetCategory>
140 return get_unsafe_ptr()->spam(prefix);
146 template<
class GetCategory>
149 return get_unsafe_ptr()->debug(prefix);
155 template<
class GetCategory>
158 return get_unsafe_ptr()->info(prefix);
164 template<
class GetCategory>
167 return get_unsafe_ptr()->warning(prefix);
173 template<
class GetCategory>
176 return get_unsafe_ptr()->error(prefix);
182 template<
class GetCategory>
185 return get_unsafe_ptr()->fatal(prefix);
194 template<
class GetCategory>
197 return get_safe_ptr();
205 template<
class GetCategory>
208 return *get_safe_ptr();
216 template<
class GetCategory>
219 return get_safe_ptr();
NotifyCategory * get_unsafe_ptr()
Returns a pointer which is assumed to have been already initialized.
A handy wrapper around a NotifyCategory pointer.
A particular category of error messages.
NotifyCategory * operator ->()
This magic operator function defines the syntax proxy->info(), etc., for all of the methods that are ...
NotifyCategory & operator *()
This operator handles the case of dereferencing the proxy object as if it were a pointer,...
NotifyCategory * get_safe_ptr()
Returns a pointer which is *not* assumed to have been already initialized; if necessary,...
NotifyCategory * init()
Initializes the proxy object by calling get_category() on the template class.