14 #ifndef NOTIFYCATEGORYPROXY_H 15 #define NOTIFYCATEGORYPROXY_H 50 template<
class GetCategory>
72 INLINE
bool is_on(NotifySeverity severity);
74 #if defined(NOTIFY_DEBUG) || defined(CPPPARSER) 75 INLINE
bool is_spam();
76 INLINE
bool is_debug();
78 constexpr
static bool is_spam() {
return false; }
79 constexpr
static bool is_debug() {
return false; }
81 INLINE
bool is_info();
82 INLINE
bool is_warning();
83 INLINE
bool is_error();
84 INLINE
bool is_fatal();
86 INLINE std::ostream &out(NotifySeverity severity,
bool prefix =
true);
87 INLINE std::ostream &spam(
bool prefix =
true);
88 INLINE std::ostream &debug(
bool prefix =
true);
89 INLINE std::ostream &info(
bool prefix =
true);
90 INLINE std::ostream &warning(
bool prefix =
true);
91 INLINE std::ostream &error(
bool prefix =
true);
92 INLINE std::ostream &fatal(
bool prefix =
true);
105 template<
class GetCategory>
107 return out << proxy->get_fullname();
118 #define NotifyCategoryDecl(basename, expcl, exptp) 120 #define NotifyCategoryDecl(basename, expcl, exptp) \ 121 class expcl NotifyCategoryGetCategory_ ## basename { \ 123 NotifyCategoryGetCategory_ ## basename(); \ 124 static NotifyCategory *get_category(); \ 126 EXPORT_TEMPLATE_CLASS(expcl, exptp, NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename>); \ 127 extern expcl NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename> basename ## _cat; 133 #define NotifyCategoryDeclNoExport(basename) \ 134 class NotifyCategoryGetCategory_ ## basename { \ 136 NotifyCategoryGetCategory_ ## basename(); \ 137 static NotifyCategory *get_category(); \ 139 extern NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename> basename ## _cat; 148 #define NotifyCategoryDefName(basename, actual_name, parent_category) 149 #define NotifyCategoryDef(basename, parent_category) 152 #define NotifyCategoryDefName(basename, actual_name, parent_category) \ 153 template class NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename>; \ 154 NotifyCategoryProxy<NotifyCategoryGetCategory_ ## basename> basename ## _cat; \ 155 static NotifyCategoryGetCategory_ ## basename force_init_ ## basename ## _cat; \ 156 NotifyCategoryGetCategory_ ## basename:: \ 157 NotifyCategoryGetCategory_ ## basename() { \ 158 basename ## _cat.init(); \ 160 NotifyCategory *NotifyCategoryGetCategory_ ## basename:: \ 162 return Notify::ptr()->get_category(std::string(actual_name), parent_category); \ 164 #define NotifyCategoryDef(basename, parent_category) \ 165 NotifyCategoryDefName(basename, #basename, parent_category); PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NotifyCategory * get_unsafe_ptr()
Returns a pointer which is assumed to have been already initialized.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A handy wrapper around a NotifyCategory pointer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NotifyCategory * init()
Initializes the proxy object by calling get_category() on the template class.