Panda3D
Loading...
Searching...
No Matches
pnotify.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file pnotify.I
10 * @author drose
11 * @date 2000-02-28
12 */
13
14/**
15 * Returns true if an assertion test has failed (and not been ignored) since
16 * the last call to clear_assert_failed().
17 *
18 * When an assertion test fails, the assert handler may decide either to
19 * abort, return, or ignore the assertion. Naturally, if it decides to abort,
20 * this flag is irrelevant. If it chooses to ignore the assertion, the flag
21 * is not set. However, if the assert handler chooses to return out of the
22 * function (the normal case), it will also set this flag to indicate that an
23 * assertion failure has occurred.
24 *
25 * This will also be the behavior in the absence of a user-defined assert
26 * handler.
27 */
28INLINE bool Notify::
29has_assert_failed() const {
30 return _assert_failed;
31}
32
33/**
34 * Returns the error message that corresponds to the assertion that most
35 * recently failed.
36 */
37INLINE const std::string &Notify::
39 return _assert_error_message;
40}
41
42/**
43 * Resets the assert_failed flag that is set whenever an assertion test fails.
44 * See has_assert_failed().
45 */
46INLINE void Notify::
48 _assert_failed = false;
49}
const std::string & get_assert_error_message() const
Returns the error message that corresponds to the assertion that most recently failed.
Definition pnotify.I:38
void clear_assert_failed()
Resets the assert_failed flag that is set whenever an assertion test fails.
Definition pnotify.I:47
bool has_assert_failed() const
Returns true if an assertion test has failed (and not been ignored) since the last call to clear_asse...
Definition pnotify.I:29