DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Class to store information about warnings in a thread-safe manner (deriving from ILockable
). All function calls are thread-safe.
More...
Classes | |
struct | WarningData |
Data associated with a warning. The class is convertible to bool (true if it describes an error/warning, false otherwise). More... | |
Public Member Functions | |
Warning () | |
Constructs an empty Warning. More... | |
Warning (std::string Description, const int ErrorCode=DynExpErrorCodes::GeneralError, const std::source_location Location=std::source_location::current()) | |
Constructs a Warning from specified information. More... | |
Warning (const Exception &e) | |
Constructs a Warning retrieving the warning data from an exception e . More... | |
Warning (Warning &&Other) noexcept | |
Constructs a Warning moving Other's warning data to this instance clearing Other's warning data. More... | |
virtual | ~Warning ()=default |
void | Reset () |
Clears the warning data. More... | |
Warning & | operator= (const Exception &e) |
Retrives the warning data from an exception e derived from Exception. More... | |
Warning & | operator= (Warning &&Other) noexcept |
Swaps in the warning data of this instance with Other's warning data. More... | |
WarningData | Get () const |
Returns a copy of the warning data. More... | |
Public Member Functions inherited from Util::INonCopyable | |
INonCopyable (const INonCopyable &)=delete | |
INonCopyable & | operator= (const INonCopyable &)=delete |
Private Attributes | |
std::unique_ptr< WarningData > | Data |
Pointer to warning data. Must never be nullptr. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Util::ILockable | |
static constexpr std::chrono::milliseconds | DefaultTimeout = std::chrono::milliseconds(10) |
Duration which is used as a default timeout within all methods of this class if no different duration is passed to them. More... | |
Protected Types inherited from Util::ILockable | |
using | MutexType = std::timed_mutex |
using | LockType = std::unique_lock< MutexType > |
Protected Member Functions inherited from Util::ILockable | |
ILockable ()=default | |
~ILockable ()=default | |
LockType | AcquireLock (const std::chrono::milliseconds Timeout=DefaultTimeout) const |
Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded. More... | |
Protected Member Functions inherited from Util::INonCopyable | |
constexpr | INonCopyable ()=default |
~INonCopyable ()=default | |
Class to store information about warnings in a thread-safe manner (deriving from ILockable
). All function calls are thread-safe.
|
inline |
|
inline |
Constructs a Warning from specified information.
Description | String describing the reason and consequences of the warning |
ErrorCode | DynExp error code from DynExpErrorCodes::DynExpErrorCodes |
Location | Origin of the warning. Do not pass anything except when deriving from this class. |
|
inline |
|
noexcept |
|
virtualdefault |
Warning::WarningData Util::Warning::Get | ( | ) | const |
|
private |