Panda3D
|
A particular category of error messages. More...
#include "notifyCategory.h"
Public Types | |
enum | ValueType { VT_undefined, VT_list, VT_string, VT_filename, VT_bool, VT_int, VT_double, VT_enum, VT_search_path, VT_int64 } |
enum | VariableFlags { F_trust_level_mask = 0x00000fff, F_open = 0x00001000, F_closed = 0x00002000, F_dynamic = 0x00004000, F_dconfig = 0x00008000 } |
Public Member Functions | |
ostream & | debug (bool prefix=true) const |
A shorthand way to write out(NS_debug). | |
ostream & | error (bool prefix=true) const |
A shorthand way to write out(NS_error). | |
ostream & | fatal (bool prefix=true) const |
A shorthand way to write out(NS_fatal). | |
string | get_basename () const |
NotifyCategory * | get_child (int i) const |
Returns the nth child Category of this particular Category. | |
string | get_fullname () const |
int | get_num_children () const |
Returns the number of child Categories of this particular Category. | |
NotifySeverity | get_severity () const |
ostream & | info (bool prefix=true) const |
A shorthand way to write out(NS_info). | |
bool | is_error () const |
A shorthand way to write is_on(NS_error). | |
bool | is_fatal () const |
A shorthand way to write is_on(NS_fatal). | |
bool | is_info () const |
A shorthand way to write is_on(NS_info). | |
bool | is_on (NotifySeverity severity) const |
Returns true if messages of the indicated severity level ought to be reported for this Category. | |
bool | is_warning () const |
A shorthand way to write is_on(NS_warning). | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
ostream & | out (NotifySeverity severity, bool prefix=true) const |
Begins a new message to this Category at the indicated severity level. | |
void | set_severity (NotifySeverity severity) |
Sets the severity level of messages that will be reported from this Category. | |
ostream & | spam (bool prefix=true) const |
A shorthand way to write out(NS_spam). | |
ostream & | warning (bool prefix=true) const |
A shorthand way to write out(NS_warning). | |
Static Public Member Functions | |
static bool | is_debug () |
When NOTIFY_DEBUG is not defined, the categories are never set to "spam" or "debug" severities, and these methods are redefined to be static to make it more obvious to the compiler. | |
static bool | is_spam () |
When NOTIFY_DEBUG is not defined, the categories are never set to "spam" or "debug" severities, and these methods are redefined to be static to make it more obvious to the compiler. | |
static void | set_server_delta (long delta) |
Sets a global delta (in seconds) between the local time and the server's time, for the purpose of synchronizing the time stamps in the log messages of the client with that of a known server. | |
Static Protected Member Functions | |
static AtomicAdjust::Integer | initial_invalid_cache () |
Returns a value that will be appropriate for initializing a local_modified value. | |
static void | invalidate_cache () |
Invalidates all of the global ConfigVariable caches in the world at once, by incrementing the global_modified counter. | |
static bool | is_cache_valid (AtomicAdjust::Integer local_modified) |
Returns true if the local object's cache is still valid (based on a comparison of the supplied local_modified value with the global_modified value). | |
static void | mark_cache_valid (AtomicAdjust::Integer &local_modified) |
Updates the indicated local_modified value so that the cache will appear to be valid, until someone next calls invalidate_cache(). | |
Friends | |
class | Notify |
A particular category of error messages.
Typically there will be one of these per package, so that we can turn on or off error messages at least at a package level; further nested categories can be created within a package if a finer grain of control is required.
Definition at line 36 of file notifyCategory.h.
ostream & NotifyCategory::debug | ( | bool | prefix = true | ) | const [inline] |
A shorthand way to write out(NS_debug).
Definition at line 188 of file notifyCategory.I.
References Notify::null(), and out().
ostream & NotifyCategory::error | ( | bool | prefix = true | ) | const [inline] |
A shorthand way to write out(NS_error).
Definition at line 222 of file notifyCategory.I.
References out().
ostream & NotifyCategory::fatal | ( | bool | prefix = true | ) | const [inline] |
A shorthand way to write out(NS_fatal).
Definition at line 232 of file notifyCategory.I.
References out().
NotifyCategory * NotifyCategory::get_child | ( | int | i | ) | const |
Returns the nth child Category of this particular Category.
Definition at line 123 of file notifyCategory.cxx.
int NotifyCategory::get_num_children | ( | ) | const |
Returns the number of child Categories of this particular Category.
Definition at line 112 of file notifyCategory.cxx.
ostream & NotifyCategory::info | ( | bool | prefix = true | ) | const [inline] |
A shorthand way to write out(NS_info).
Definition at line 202 of file notifyCategory.I.
References out().
AtomicAdjust::Integer ConfigFlags::initial_invalid_cache | ( | ) | [inline, static, protected, inherited] |
Returns a value that will be appropriate for initializing a local_modified value.
This value will indicate an invalid cache in the next call to is_cache_valid().
Definition at line 49 of file configFlags.I.
Referenced by ConfigVariableSearchPath::append_directory(), ConfigVariableSearchPath::append_path(), ConfigVariableSearchPath::clear_local_value(), ConfigVariableSearchPath::prepend_directory(), and ConfigVariableSearchPath::prepend_path().
void ConfigFlags::invalidate_cache | ( | ) | [inline, static, protected, inherited] |
Invalidates all of the global ConfigVariable caches in the world at once, by incrementing the global_modified counter.
Definition at line 61 of file configFlags.I.
Referenced by ConfigVariableCore::clear_local_value(), ConfigPageManager::delete_explicit_page(), ConfigPageManager::make_explicit_page(), ConfigPageManager::reload_implicit_pages(), ConfigDeclaration::set_bool_word(), ConfigDeclaration::set_double_word(), ConfigDeclaration::set_int64_word(), ConfigDeclaration::set_int_word(), set_severity(), ConfigDeclaration::set_string_value(), and ConfigDeclaration::set_string_word().
bool ConfigFlags::is_cache_valid | ( | AtomicAdjust::Integer | local_modified | ) | [inline, static, protected, inherited] |
Returns true if the local object's cache is still valid (based on a comparison of the supplied local_modified value with the global_modified value).
Definition at line 24 of file configFlags.I.
Referenced by ConfigVariableString::get_value(), ConfigVariableInt64::get_value(), ConfigVariableInt::get_value(), ConfigVariableFilename::get_value(), ConfigVariableDouble::get_value(), and ConfigVariableBool::get_value().
bool NotifyCategory::is_debug | ( | ) | [inline, static] |
When NOTIFY_DEBUG is not defined, the categories are never set to "spam" or "debug" severities, and these methods are redefined to be static to make it more obvious to the compiler.
Definition at line 123 of file notifyCategory.I.
bool NotifyCategory::is_error | ( | ) | const [inline] |
A shorthand way to write is_on(NS_error).
Definition at line 154 of file notifyCategory.I.
References is_on().
bool NotifyCategory::is_fatal | ( | ) | const [inline] |
A shorthand way to write is_on(NS_fatal).
Definition at line 164 of file notifyCategory.I.
References is_on().
bool NotifyCategory::is_info | ( | ) | const [inline] |
A shorthand way to write is_on(NS_info).
Definition at line 134 of file notifyCategory.I.
References is_on().
bool NotifyCategory::is_on | ( | NotifySeverity | severity | ) | const [inline] |
Returns true if messages of the indicated severity level ought to be reported for this Category.
Definition at line 75 of file notifyCategory.I.
Referenced by is_error(), is_fatal(), is_info(), is_warning(), and out().
bool NotifyCategory::is_spam | ( | ) | [inline, static] |
When NOTIFY_DEBUG is not defined, the categories are never set to "spam" or "debug" severities, and these methods are redefined to be static to make it more obvious to the compiler.
Definition at line 110 of file notifyCategory.I.
bool NotifyCategory::is_warning | ( | ) | const [inline] |
A shorthand way to write is_on(NS_warning).
Definition at line 144 of file notifyCategory.I.
References is_on().
void ConfigFlags::mark_cache_valid | ( | AtomicAdjust::Integer & | local_modified | ) | [inline, static, protected, inherited] |
Updates the indicated local_modified value so that the cache will appear to be valid, until someone next calls invalidate_cache().
Definition at line 36 of file configFlags.I.
Referenced by ConfigVariableString::get_value(), ConfigVariableInt64::get_value(), ConfigVariableInt::get_value(), ConfigVariableDouble::get_value(), and ConfigVariableBool::get_value().
ostream & NotifyCategory::out | ( | NotifySeverity | severity, |
bool | prefix = true |
||
) | const |
Begins a new message to this Category at the indicated severity level.
If the indicated severity level is enabled, this writes a prefixing string to the Notify::out() stream and returns that. If the severity level is disabled, this returns Notify::null().
Definition at line 62 of file notifyCategory.cxx.
References is_on(), and Notify::null().
Referenced by debug(), error(), fatal(), info(), spam(), and warning().
void NotifyCategory::set_server_delta | ( | long | delta | ) | [static] |
Sets a global delta (in seconds) between the local time and the server's time, for the purpose of synchronizing the time stamps in the log messages of the client with that of a known server.
Definition at line 137 of file notifyCategory.cxx.
void NotifyCategory::set_severity | ( | NotifySeverity | severity | ) | [inline] |
Sets the severity level of messages that will be reported from this Category.
This allows any message of this severity level or higher.
Definition at line 58 of file notifyCategory.I.
References ConfigFlags::invalidate_cache().
ostream & NotifyCategory::spam | ( | bool | prefix = true | ) | const [inline] |
A shorthand way to write out(NS_spam).
Definition at line 174 of file notifyCategory.I.
References Notify::null(), and out().
ostream & NotifyCategory::warning | ( | bool | prefix = true | ) | const [inline] |
A shorthand way to write out(NS_warning).
Definition at line 212 of file notifyCategory.I.
References out().