00001 // Filename: notifyCategory.I 00002 // Created by: drose (29Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: NotifyCategory::get_fullname 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE string NotifyCategory:: 00026 get_fullname() const { 00027 return _fullname; 00028 } 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Function: NotifyCategory::get_basename 00032 // Access: Public 00033 // Description: 00034 //////////////////////////////////////////////////////////////////// 00035 INLINE string NotifyCategory:: 00036 get_basename() const { 00037 return _basename; 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function: NotifyCategory::get_severity 00042 // Access: Public 00043 // Description: 00044 //////////////////////////////////////////////////////////////////// 00045 INLINE NotifySeverity NotifyCategory:: 00046 get_severity() const { 00047 return _severity; 00048 } 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: NotifyCategory::set_severity 00052 // Access: Public 00053 // Description: Sets the severity level of messages that will be 00054 // reported from this Category. This allows any message 00055 // of this severity level or higher. 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE void NotifyCategory:: 00058 set_severity(NotifySeverity severity) { 00059 _severity = severity; 00060 } 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function: NotifyCategory::is_on 00064 // Access: Public 00065 // Description: Returns true if messages of the indicated severity 00066 // level ought to be reported for this Category. 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE bool NotifyCategory:: 00069 is_on(NotifySeverity severity) const { 00070 return (int)severity >= (int)_severity; 00071 } 00072 00073 #if defined(NOTIFY_DEBUG) || defined(CPPPARSER) 00074 //////////////////////////////////////////////////////////////////// 00075 // Function: NotifyCategory::is_spam 00076 // Access: Public 00077 // Description: A shorthand way to write is_on(NS_spam). 00078 //////////////////////////////////////////////////////////////////// 00079 INLINE bool NotifyCategory:: 00080 is_spam() const { 00081 return is_on(NS_spam); 00082 } 00083 00084 //////////////////////////////////////////////////////////////////// 00085 // Function: NotifyCategory::is_debug 00086 // Access: Public 00087 // Description: A shorthand way to write is_on(NS_debug). 00088 //////////////////////////////////////////////////////////////////// 00089 INLINE bool NotifyCategory:: 00090 is_debug() const { 00091 return is_on(NS_debug); 00092 } 00093 #else 00094 //////////////////////////////////////////////////////////////////// 00095 // Function: NotifyCategory::is_spam 00096 // Access: Public, Static 00097 // Description: When NOTIFY_DEBUG is not defined, the categories are 00098 // never set to "spam" or "debug" severities, and these 00099 // methods are redefined to be static to make it more 00100 // obvious to the compiler. 00101 //////////////////////////////////////////////////////////////////// 00102 INLINE bool NotifyCategory:: 00103 is_spam() { 00104 return false; 00105 } 00106 00107 //////////////////////////////////////////////////////////////////// 00108 // Function: NotifyCategory::is_debug 00109 // Access: Public 00110 // Description: When NOTIFY_DEBUG is not defined, the categories are 00111 // never set to "spam" or "debug" severities, and these 00112 // methods are redefined to be static to make it more 00113 // obvious to the compiler. 00114 //////////////////////////////////////////////////////////////////// 00115 INLINE bool NotifyCategory:: 00116 is_debug() { 00117 return false; 00118 } 00119 #endif 00120 00121 //////////////////////////////////////////////////////////////////// 00122 // Function: NotifyCategory::is_info 00123 // Access: Public 00124 // Description: A shorthand way to write is_on(NS_info). 00125 //////////////////////////////////////////////////////////////////// 00126 INLINE bool NotifyCategory:: 00127 is_info() const { 00128 return is_on(NS_info); 00129 } 00130 00131 //////////////////////////////////////////////////////////////////// 00132 // Function: NotifyCategory::is_warning 00133 // Access: Public 00134 // Description: A shorthand way to write is_on(NS_warning). 00135 //////////////////////////////////////////////////////////////////// 00136 INLINE bool NotifyCategory:: 00137 is_warning() const { 00138 return is_on(NS_warning); 00139 } 00140 00141 //////////////////////////////////////////////////////////////////// 00142 // Function: NotifyCategory::is_error 00143 // Access: Public 00144 // Description: A shorthand way to write is_on(NS_error). 00145 //////////////////////////////////////////////////////////////////// 00146 INLINE bool NotifyCategory:: 00147 is_error() const { 00148 return is_on(NS_error); 00149 } 00150 00151 //////////////////////////////////////////////////////////////////// 00152 // Function: NotifyCategory::is_fatal 00153 // Access: Public 00154 // Description: A shorthand way to write is_on(NS_fatal). 00155 //////////////////////////////////////////////////////////////////// 00156 INLINE bool NotifyCategory:: 00157 is_fatal() const { 00158 return is_on(NS_fatal); 00159 } 00160 00161 //////////////////////////////////////////////////////////////////// 00162 // Function: NotifyCategory::spam 00163 // Access: Public 00164 // Description: A shorthand way to write out(NS_spam). 00165 //////////////////////////////////////////////////////////////////// 00166 INLINE ostream &NotifyCategory:: 00167 spam(bool prefix) const { 00168 return out(NS_spam, prefix); 00169 } 00170 00171 //////////////////////////////////////////////////////////////////// 00172 // Function: NotifyCategory::debug 00173 // Access: Public 00174 // Description: A shorthand way to write out(NS_debug). 00175 //////////////////////////////////////////////////////////////////// 00176 INLINE ostream &NotifyCategory:: 00177 debug(bool prefix) const { 00178 return out(NS_debug, prefix); 00179 } 00180 00181 //////////////////////////////////////////////////////////////////// 00182 // Function: NotifyCategory::info 00183 // Access: Public 00184 // Description: A shorthand way to write out(NS_info). 00185 //////////////////////////////////////////////////////////////////// 00186 INLINE ostream &NotifyCategory:: 00187 info(bool prefix) const { 00188 return out(NS_info, prefix); 00189 } 00190 00191 //////////////////////////////////////////////////////////////////// 00192 // Function: NotifyCategory::warning 00193 // Access: Public 00194 // Description: A shorthand way to write out(NS_warning). 00195 //////////////////////////////////////////////////////////////////// 00196 INLINE ostream &NotifyCategory:: 00197 warning(bool prefix) const { 00198 return out(NS_warning, prefix); 00199 } 00200 00201 //////////////////////////////////////////////////////////////////// 00202 // Function: NotifyCategory::error 00203 // Access: Public 00204 // Description: A shorthand way to write out(NS_error). 00205 //////////////////////////////////////////////////////////////////// 00206 INLINE ostream &NotifyCategory:: 00207 error(bool prefix) const { 00208 return out(NS_error, prefix); 00209 } 00210 00211 //////////////////////////////////////////////////////////////////// 00212 // Function: NotifyCategory::fatal 00213 // Access: Public 00214 // Description: A shorthand way to write out(NS_fatal). 00215 //////////////////////////////////////////////////////////////////// 00216 INLINE ostream &NotifyCategory:: 00217 fatal(bool prefix) const { 00218 return out(NS_fatal, prefix); 00219 }