Helper similar to std::unique_lock for detecting when calculations such as has_special have entered infinite recursion. More...
#include <attack_type.hpp>
Public Member Functions | |
| recursion_guard () | |
| Construct an empty instance, only useful for extending the lifetime of a recursion_guard returned from weapon.update_variables_recursion() by std::moving it to an instance declared in a larger scope. More... | |
| operator bool () const | |
| Returns true if a level of recursion was available at the time when update_variables_recursion() created this object. More... | |
| recursion_guard (recursion_guard &&other) noexcept | |
| recursion_guard (const recursion_guard &other)=delete | |
| recursion_guard & | operator= (recursion_guard &&) noexcept |
| recursion_guard & | operator= (const recursion_guard &)=delete |
| ~recursion_guard () | |
Private Member Functions | |
| recursion_guard (const attack_type &weapon, const config &special) | |
| Only expected to be called in update_variables_recursion(), which handles some of the checks. More... | |
Private Attributes | |
| std::shared_ptr< const attack_type > | parent |
Friends | |
| class | attack_type |
Helper similar to std::unique_lock for detecting when calculations such as has_special have entered infinite recursion.
This assumes that there's only a single thread accessing the attack_type, it's a lightweight increment/decrement counter rather than a mutex.
Definition at line 182 of file attack_type.hpp.
|
explicitprivate |
Only expected to be called in update_variables_recursion(), which handles some of the checks.
Definition at line 615 of file attack_type.cpp.
References parent.
|
explicitdefault |
Construct an empty instance, only useful for extending the lifetime of a recursion_guard returned from weapon.update_variables_recursion() by std::moving it to an instance declared in a larger scope.
|
noexcept |
Definition at line 621 of file attack_type.cpp.
References swap().
|
delete |
| attack_type::recursion_guard::~recursion_guard | ( | ) |
Definition at line 641 of file attack_type.cpp.
| attack_type::recursion_guard::operator bool | ( | ) | const |
Returns true if a level of recursion was available at the time when update_variables_recursion() created this object.
Definition at line 626 of file attack_type.cpp.
|
delete |
|
noexcept |
Definition at line 630 of file attack_type.cpp.
References swap().
|
friend |
Definition at line 183 of file attack_type.hpp.
|
private |
Definition at line 208 of file attack_type.hpp.
Referenced by recursion_guard().