9#include <ChimeraTK/cppext/finally.hpp>
12#include <condition_variable>
15#include <shared_mutex>
30 std::cerr <<
"Removed function DeviceBackendImpl::isConnected() called." << std::endl;
31 std::cerr <<
"Do not use. This function has no valid meaning." << std::endl;
71 std::atomic<bool> _hasActiveException{
false};
77 std::string _activeExceptionMessage;
80 std::mutex _mx_activeExceptionMessage;
88 if(_hasActiveException)
return false;
96 if(_hasActiveException) {
97 std::lock_guard<std::mutex> lk(_mx_activeExceptionMessage);
The base class for backends providing IO functionality for the Device class.
DeviceBackendImpl implements some basic functionality which should be available for all backends.
async::DomainsContainer _asyncDomainsContainer
Container for async::Domains to support wait_for_new_data.
bool isFunctional() const noexcept final
Return whether a device is working as intended, usually this means it is opened and does not have any...
void setOpenedAndClearException() noexcept
Backends should call this function at the end of a (successful) open() call.
std::string getActiveExceptionMessage() noexcept
bool isConnected() final
Deprecated since 2022-03-03.
virtual void setExceptionImpl() noexcept
Function to be (optionally) implemented by backends if additional actions are needed when switching t...
MetadataCatalogue getMetadataCatalogue() const override
Return the device metadata catalogue.
void setException(const std::string &message) noexcept final
Set the backend into an exception state.
void checkActiveException() final
Function to be called by backends when needing to check for an active exception.
std::set< DeviceBackend::BackendID > getInvolvedBackendIDs() override
Get the backend IDs of all involved backends.
bool isOpen() override
Return whether a device has been opened or not.
std::atomic< bool > _opened
flag if backend is opened
The DomainsContainer has a container with Domains and is performing actions on all of them.
Exception thrown when a runtime error has occured.