00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 INLINE string NotifyCategory::
00022 get_fullname() const {
00023 return _fullname;
00024 }
00025
00026
00027
00028
00029
00030
00031 INLINE string NotifyCategory::
00032 get_basename() const {
00033 return _basename;
00034 }
00035
00036
00037
00038
00039
00040
00041 NotifySeverity NotifyCategory::
00042 get_severity() const {
00043 TAU_PROFILE("NotifyCategory NotifyCategory::get_severity() const", " ", TAU_USER);
00044 if (!is_cache_valid(_local_modified)) {
00045 ((NotifyCategory *)this)->update_severity_cache();
00046 }
00047 return _severity_cache;
00048 }
00049
00050
00051
00052
00053
00054
00055
00056
00057 INLINE void NotifyCategory::
00058 set_severity(NotifySeverity severity) {
00059 #if defined(NOTIFY_DEBUG)
00060 _severity = severity;
00061 #else
00062
00063 _severity = max(severity, NS_info);
00064 #endif
00065 invalidate_cache();
00066 }
00067
00068
00069
00070
00071
00072
00073
00074 INLINE bool NotifyCategory::
00075 is_on(NotifySeverity severity) const {
00076 TAU_PROFILE("bool NotifyCategory::is_on(NotifySeverity) const", " ", TAU_USER);
00077 return (int)severity >= (int)get_severity();
00078 }
00079
00080 #if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
00081
00082
00083
00084
00085
00086 INLINE bool NotifyCategory::
00087 is_spam() const {
00088 return is_on(NS_spam);
00089 }
00090
00091
00092
00093
00094
00095
00096 INLINE bool NotifyCategory::
00097 is_debug() const {
00098 return is_on(NS_debug);
00099 }
00100 #else
00101
00102
00103
00104
00105
00106
00107
00108
00109 INLINE bool NotifyCategory::
00110 is_spam() {
00111 return false;
00112 }
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 INLINE bool NotifyCategory::
00123 is_debug() {
00124 return false;
00125 }
00126 #endif
00127
00128
00129
00130
00131
00132
00133 INLINE bool NotifyCategory::
00134 is_info() const {
00135 return is_on(NS_info);
00136 }
00137
00138
00139
00140
00141
00142
00143 INLINE bool NotifyCategory::
00144 is_warning() const {
00145 return is_on(NS_warning);
00146 }
00147
00148
00149
00150
00151
00152
00153 INLINE bool NotifyCategory::
00154 is_error() const {
00155 return is_on(NS_error);
00156 }
00157
00158
00159
00160
00161
00162
00163 INLINE bool NotifyCategory::
00164 is_fatal() const {
00165 return is_on(NS_fatal);
00166 }
00167
00168
00169
00170
00171
00172
00173 INLINE ostream &NotifyCategory::
00174 spam(bool prefix) const {
00175 #if defined(NOTIFY_DEBUG)
00176 return out(NS_spam, prefix);
00177 #else
00178 return Notify::null();
00179 #endif
00180 }
00181
00182
00183
00184
00185
00186
00187 INLINE ostream &NotifyCategory::
00188 debug(bool prefix) const {
00189 #if defined(NOTIFY_DEBUG)
00190 return out(NS_debug, prefix);
00191 #else
00192 return Notify::null();
00193 #endif
00194 }
00195
00196
00197
00198
00199
00200
00201 INLINE ostream &NotifyCategory::
00202 info(bool prefix) const {
00203 return out(NS_info, prefix);
00204 }
00205
00206
00207
00208
00209
00210
00211 INLINE ostream &NotifyCategory::
00212 warning(bool prefix) const {
00213 return out(NS_warning, prefix);
00214 }
00215
00216
00217
00218
00219
00220
00221 INLINE ostream &NotifyCategory::
00222 error(bool prefix) const {
00223 return out(NS_error, prefix);
00224 }
00225
00226
00227
00228
00229
00230
00231 INLINE ostream &NotifyCategory::
00232 fatal(bool prefix) const {
00233 return out(NS_fatal, prefix);
00234 }
00235
00236 INLINE ostream &
00237 operator << (ostream &out, const NotifyCategory &cat) {
00238 return out << cat.get_fullname();
00239 }