Go to the documentation of this file.
14 #ifndef NOTIFYCATEGORYPROXY_H
15 #define NOTIFYCATEGORYPROXY_H
50 template<
class GetCategory>
72 INLINE
bool is_on(NotifySeverity severity);
74 INLINE
bool is_spam();
75 INLINE
bool is_debug();
76 INLINE
bool is_info();
77 INLINE
bool is_warning();
78 INLINE
bool is_error();
79 INLINE
bool is_fatal();
81 INLINE std::ostream &out(NotifySeverity severity,
bool prefix =
true);
82 INLINE std::ostream &spam(
bool prefix =
true);
83 INLINE std::ostream &debug(
bool prefix =
true);
84 INLINE std::ostream &info(
bool prefix =
true);
85 INLINE std::ostream &warning(
bool prefix =
true);
86 INLINE std::ostream &error(
bool prefix =
true);
87 INLINE std::ostream &fatal(
bool prefix =
true);
100 template<
class GetCategory>
102 return out << proxy->get_fullname();
113 #define NotifyCategoryDecl(basename, expcl, exptp)
115 #define NotifyCategoryDecl(basename, expcl, exptp) \
116 class expcl NotifyCategoryGetCategory_ ## basename { \
118 NotifyCategoryGetCategory_ ## basename(); \
119 static NotifyCategory *get_category(); \
121 EXPORT_TEMPLATE_CLASS(expcl, exptp, NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename>); \
122 extern expcl NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename> basename ## _cat;
128 #define NotifyCategoryDeclNoExport(basename) \
129 class NotifyCategoryGetCategory_ ## basename { \
131 NotifyCategoryGetCategory_ ## basename(); \
132 static NotifyCategory *get_category(); \
134 extern NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename> basename ## _cat;
143 #define NotifyCategoryDefName(basename, actual_name, parent_category)
144 #define NotifyCategoryDef(basename, parent_category)
147 #define NotifyCategoryDefName(basename, actual_name, parent_category) \
148 template class NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename>; \
149 NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename> basename ## _cat; \
150 static NotifyCategoryGetCategory_ ## basename force_init_ ## basename ## _cat; \
151 NotifyCategoryGetCategory_ ## basename:: \
152 NotifyCategoryGetCategory_ ## basename() { \
153 basename ## _cat.init(); \
155 NotifyCategory *NotifyCategoryGetCategory_ ## basename:: \
157 return Notify::ptr()->get_category(std::string(actual_name), parent_category); \
159 #define NotifyCategoryDef(basename, parent_category) \
160 NotifyCategoryDefName(basename, #basename, parent_category);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NotifyCategory * operator->()
This magic operator function defines the syntax proxy->info(), etc., for all of the methods that are ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NotifyCategory * get_safe_ptr()
Returns a pointer which is *not* assumed to have been already initialized; if necessary,...
NotifyCategory & operator*()
This operator handles the case of dereferencing the proxy object as if it were a pointer,...
NotifyCategory * init()
Initializes the proxy object by calling get_category() on the template class.
A handy wrapper around a NotifyCategory pointer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NotifyCategory * get_unsafe_ptr()
Returns a pointer which is assumed to have been already initialized.
A particular category of error messages.