Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NotifyCategory Class Reference

A particular category of error messages. More...

#include <notifyCategory.h>

List of all members.

Public Member Functions

string get_fullname () const
string get_basename () const
NotifySeverity get_severity () const
void set_severity (NotifySeverity severity)
 Sets the severity level of messages that will be reported from this Category.

bool is_on (NotifySeverity severity) const
 Returns true if messages of the indicated severity level ought to be reported for this Category.

bool is_info () const
 A shorthand way to write is_on(NS_info).

bool is_warning () const
 A shorthand way to write is_on(NS_warning).

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).

ostream & out (NotifySeverity severity, bool prefix=true) const
 Begins a new message to this Category at the indicated severity level.

ostream & spam (bool prefix=true) const
 A shorthand way to write out(NS_spam).

ostream & debug (bool prefix=true) const
 A shorthand way to write out(NS_debug).

ostream & info (bool prefix=true) const
 A shorthand way to write out(NS_info).

ostream & warning (bool prefix=true) const
 A shorthand way to write out(NS_warning).

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).

int get_num_children () const
 Returns the number of child Categories of this particular Category.

NotifyCategory * get_child (int i) const
 Returns the nth child Category of this particular Category.


Static Public Member Functions

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.

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.

void set_server_delta (time_t 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.


Private Types

typedef vector< NotifyCategory * > Children

Private Member Functions

 NotifyCategory (const string &fullname, const string &basename, NotifyCategory *parent)

Private Attributes

string _fullname
string _basename
NotifyCategory * _parent
NotifySeverity _severity
Children _children

Static Private Attributes

time_t _server_delta = 0

Friends

class Notify


Detailed Description

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 48 of file notifyCategory.h.


Member Typedef Documentation

typedef vector<NotifyCategory *> NotifyCategory::Children [private]
 

Definition at line 97 of file notifyCategory.h.


Constructor & Destructor Documentation

NotifyCategory::NotifyCategory const string &  fullname,
const string &  basename,
NotifyCategory *  parent
[private]
 

Definition at line 39 of file notifyCategory.cxx.

References _basename, _children, _fullname, _parent, _severity, nassertv, nout, NS_info, NS_unspecified, NULL, and Notify::string_severity().


Member Function Documentation

ostream & NotifyCategory::debug bool  prefix = true  )  const [inline]
 

A shorthand way to write out(NS_debug).

Definition at line 231 of file notifyCategory.I.

Referenced by NotifyCategoryProxy< GetCategory >::is_error().

ostream & NotifyCategory::error bool  prefix = true  )  const [inline]
 

A shorthand way to write out(NS_error).

Definition at line 270 of file notifyCategory.I.

Referenced by NotifyCategoryProxy< GetCategory >::spam().

ostream & NotifyCategory::fatal bool  prefix = true  )  const [inline]
 

A shorthand way to write out(NS_fatal).

Definition at line 283 of file notifyCategory.I.

Referenced by NotifyCategoryProxy< GetCategory >::debug().

string NotifyCategory::get_basename  )  const [inline]
 

Definition at line 43 of file notifyCategory.I.

References _severity, INLINE, and NotifySeverity.

NotifyCategory * NotifyCategory::get_child int  i  )  const
 

Returns the nth child Category of this particular Category.

Definition at line 166 of file notifyCategory.cxx.

string NotifyCategory::get_fullname  )  const [inline]
 

Definition at line 31 of file notifyCategory.I.

References _basename, and INLINE.

int NotifyCategory::get_num_children  )  const
 

Returns the number of child Categories of this particular Category.

Definition at line 151 of file notifyCategory.cxx.

References _server_delta.

NotifySeverity NotifyCategory::get_severity  )  const [inline]
 

Definition at line 55 of file notifyCategory.I.

References _severity, and INLINE.

ostream & NotifyCategory::info bool  prefix = true  )  const [inline]
 

A shorthand way to write out(NS_info).

Definition at line 244 of file notifyCategory.I.

Referenced by NotifyCategoryProxy< GetCategory >::is_fatal().

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 152 of file notifyCategory.I.

References INLINE, is_on(), and NS_fatal.

Referenced by NotifyCategoryProxy< GetCategory >::is_on().

bool NotifyCategory::is_error  )  const [inline]
 

A shorthand way to write is_on(NS_error).

Definition at line 192 of file notifyCategory.I.

References INLINE, NS_warning, and out().

Referenced by NotifyCategoryProxy< GetCategory >::is_debug().

bool NotifyCategory::is_fatal  )  const [inline]
 

A shorthand way to write is_on(NS_fatal).

Definition at line 205 of file notifyCategory.I.

References INLINE, NS_error, and out().

Referenced by NotifyCategoryProxy< GetCategory >::is_info().

bool NotifyCategory::is_info  )  const [inline]
 

A shorthand way to write is_on(NS_info).

Definition at line 166 of file notifyCategory.I.

References INLINE, NS_spam, and out().

Referenced by NotifyCategoryProxy< GetCategory >::is_spam().

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 87 of file notifyCategory.I.

References INLINE, and NS_debug.

Referenced by is_debug(), is_spam(), and set_severity().

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 133 of file notifyCategory.I.

References INLINE, is_on(), and NS_warning.

bool NotifyCategory::is_warning  )  const [inline]
 

A shorthand way to write is_on(NS_warning).

Definition at line 179 of file notifyCategory.I.

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 114 of file notifyCategory.cxx.

References nout, and NS_info.

Referenced by is_error(), is_fatal(), and is_info().

void NotifyCategory::set_server_delta time_t  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 186 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 72 of file notifyCategory.I.

References INLINE, is_on(), and NS_spam.

ostream & NotifyCategory::spam bool  prefix = true  )  const [inline]
 

A shorthand way to write out(NS_spam).

Definition at line 218 of file notifyCategory.I.

ostream & NotifyCategory::warning bool  prefix = true  )  const [inline]
 

A shorthand way to write out(NS_warning).

Definition at line 257 of file notifyCategory.I.

Referenced by NotifyCategoryProxy< GetCategory >::out().


Friends And Related Function Documentation

friend class Notify [friend]
 

Definition at line 102 of file notifyCategory.h.


Member Data Documentation

string NotifyCategory::_basename [private]
 

Definition at line 94 of file notifyCategory.h.

Referenced by get_fullname(), and NotifyCategory().

Children NotifyCategory::_children [private]
 

Definition at line 98 of file notifyCategory.h.

Referenced by NotifyCategory().

string NotifyCategory::_fullname [private]
 

Definition at line 93 of file notifyCategory.h.

Referenced by NotifyCategory().

NotifyCategory* NotifyCategory::_parent [private]
 

Definition at line 95 of file notifyCategory.h.

Referenced by NotifyCategory().

time_t NotifyCategory::_server_delta = 0 [static, private]
 

Definition at line 29 of file notifyCategory.cxx.

Referenced by get_num_children().

NotifySeverity NotifyCategory::_severity [private]
 

Definition at line 96 of file notifyCategory.h.

Referenced by get_basename(), get_severity(), and NotifyCategory().


The documentation for this class was generated from the following files:
Generated on Thu May 1 22:13:40 2003 for DTool by doxygen1.3