This type is used for debugging and asserting types TCondition. With debug compilations that class holds one member of this struct, which aggregates all debug information.
Definition at line 320 of file dbgasserters.hpp.
#include <dbgasserters.hpp>
Inner Type Index: | |
| struct | ActionInfo |
| Collects caller info and the sequence number of actions. More... | |
Public Static Field Index: | |
| static const char * | ASSERTION_FORMAT |
Public Field Index: | |
| ActionInfo | Acq |
| Source location of the most recent acquirement. | |
| std::atomic< int > | ActionCounter {1} |
| Counter of the actions. | |
| std::thread::id | AssertExclusiveWaiter |
| std::atomic< int > | CntWaiters {0} |
| The number of currently waiting threads. | |
| const character * | Name |
| The name of this instance. | |
| ActionInfo | Notify |
The most recent call to ReleaseAndNotify. | |
| Thread * | Owner {nullptr} |
| Tracks the current owner. | |
| ActionInfo | Rel |
| Source location of the most recent release. | |
| ActionInfo | Wait |
Public Method Index: | |
| void | Assert (bool cond, const CallerInfo &assertCI, const CallerInfo &ci, const char *headline) |
| bool | IsOwnedByCurrentThread () const |
| ActionInfo alib::threads::DbgConditionAsserter::Acq |
Source location of the most recent acquirement.
Definition at line 330 of file dbgasserters.hpp.
| std::atomic<int> alib::threads::DbgConditionAsserter::ActionCounter {1} |
Counter of the actions.
Definition at line 328 of file dbgasserters.hpp.
| std::thread::id alib::threads::DbgConditionAsserter::AssertExclusiveWaiter |
If set from outside, overloaded methods WaitForNotification(ALIB_DBG_TAKE_CI) will raise an assertion in the case they are called from a different thread.
Definition at line 336 of file dbgasserters.hpp.
|
static |
The format string used to write exceptions to the console. This string can be changed if the source information is not "clickable" in a user's development environment.
The default string is optimized for JetBrains CLion and is defined as:
Assertion failed in method TCondition::{}
Message: {}
Instance: {}
Called By: {}::{}
At: {}:{}
Thread: {}
Current Owner: {}
#Of Waiters: {}
Exclusive Waiter: {}
Latest Acquisition By: {}::{}
At: {}:{}
Seq / Thread: {} / {}
Latest Release By: {}::{}
At: {}:{}
Seq / Thread: {} / {}
Latest Wait By: {}::{}
At: {}:{}
Seq / Thread: {} / {}
Latest Notify By: {}::{}
At: {}:{}
Seq / Thread: {} / {}
Definition at line 376 of file dbgasserters.hpp.
| std::atomic<int> alib::threads::DbgConditionAsserter::CntWaiters {0} |
The number of currently waiting threads.
Definition at line 335 of file dbgasserters.hpp.
| const character* alib::threads::DbgConditionAsserter::Name |
The name of this instance.
Definition at line 327 of file dbgasserters.hpp.
| ActionInfo alib::threads::DbgConditionAsserter::Notify |
The most recent call to ReleaseAndNotify.
Definition at line 334 of file dbgasserters.hpp.
| Thread* alib::threads::DbgConditionAsserter::Owner {nullptr} |
Tracks the current owner.
Definition at line 329 of file dbgasserters.hpp.
| ActionInfo alib::threads::DbgConditionAsserter::Rel |
Source location of the most recent release.
Definition at line 331 of file dbgasserters.hpp.
| ActionInfo alib::threads::DbgConditionAsserter::Wait |
The most recent call to WaitForNotification(ALIB_DBG_TAKE_CI).
Definition at line 332 of file dbgasserters.hpp.
| void alib::threads::DbgConditionAsserter::Assert | ( | bool | cond, |
| const CallerInfo & | assertCI, | ||
| const CallerInfo & | ci, | ||
| const char * | headline ) |
Writes assertion info and calls ALIB_ASSERT.
| cond | The condition that is to be met. |
| assertCI | Location where the assertion is placed. |
| ci | Location of the call to the method that asserted. |
| headline | The message. |
Definition at line 118 of file dbgasserters.cpp.
|
inline |
Returns true if the current owner is the current thread.
Available only in debug-builds.
true, if the lock is owned by this thread, false if it is owned by another thread or not owned. Definition at line 394 of file dbgasserters.hpp.