Panda3D
Public Member Functions | Static Public Member Functions | List of all members
Notify Class Reference

An object that handles general error reporting to the user. It contains a pointer to an ostream, initially cerr, which can be reset at will to point to different output devices, according to the needs of the application. All output generated within Panda should vector through the Notify ostream. More...

Public Member Functions

 __init__ ()
 
 clearAssertFailed ()
 Resets the assert_failed flag that is set whenever an assertion test fails. See has_assert_failed(). More...
 
 clearAssertHandler ()
 
str getAssertErrorMessage ()
 Returns the error message that corresponds to the assertion that most recently failed. More...
 
 getAssertHandler ()
 
NotifyCategory getCategory (str fullname)
 
NotifyCategory getCategory (str basename, NotifyCategory parent_category)
 
NotifyCategory getCategory (str basename, str parent_fullname)
 
Ostream getOstreamPtr ()
 
NotifyCategory getTopCategory ()
 
bool hasAssertFailed ()
 Returns true if an assertion test has failed (and not been ignored) since the last call to clear_assert_failed(). More...
 
bool hasAssertHandler ()
 
 setOstreamPtr (Ostream ostream_ptr, bool delete_later)
 

Static Public Member Functions

static Ostream null ()
 
static Ostream out ()
 
static Notify ptr ()
 
static writeString (str str)
 

Detailed Description

An object that handles general error reporting to the user. It contains a pointer to an ostream, initially cerr, which can be reset at will to point to different output devices, according to the needs of the application. All output generated within Panda should vector through the Notify ostream.

This also includes a collection of Categories and Severities, which may be independently enabled or disabled, so that error messages may be squelched or respected according to the wishes of the user.

Member Function Documentation

◆ __init__()

__init__ ( )

◆ clearAssertFailed()

clearAssertFailed ( )

Resets the assert_failed flag that is set whenever an assertion test fails. See has_assert_failed().

◆ clearAssertHandler()

clearAssertHandler ( )

◆ getAssertErrorMessage()

str getAssertErrorMessage ( )

Returns the error message that corresponds to the assertion that most recently failed.

◆ getAssertHandler()

getAssertHandler ( )

◆ getCategory() [1/3]

NotifyCategory getCategory ( str  fullname)

◆ getCategory() [2/3]

NotifyCategory getCategory ( str  basename,
NotifyCategory  parent_category 
)

◆ getCategory() [3/3]

NotifyCategory getCategory ( str  basename,
str  parent_fullname 
)

◆ getOstreamPtr()

Ostream getOstreamPtr ( )

◆ getTopCategory()

NotifyCategory getTopCategory ( )

◆ hasAssertFailed()

bool hasAssertFailed ( )

Returns true if an assertion test has failed (and not been ignored) since the last call to clear_assert_failed().

When an assertion test fails, the assert handler may decide either to abort, return, or ignore the assertion. Naturally, if it decides to abort, this flag is irrelevant. If it chooses to ignore the assertion, the flag is not set. However, if the assert handler chooses to return out of the function (the normal case), it will also set this flag to indicate that an assertion failure has occurred.

This will also be the behavior in the absence of a user-defined assert handler.

◆ hasAssertHandler()

bool hasAssertHandler ( )

◆ null()

static Ostream null ( )
static

◆ out()

static Ostream out ( )
static

◆ ptr()

static Notify ptr ( )
static

◆ setOstreamPtr()

setOstreamPtr ( Ostream  ostream_ptr,
bool  delete_later 
)

◆ writeString()

static writeString ( str  str)
static