12#include <ChimeraTK/async/DataConsistencyRealm.h>
13#include <ChimeraTK/DeviceBackendImpl.h>
14#include <ChimeraTK/VersionNumber.h>
21 class DoocsBackendRegisterAccessorBase;
61 DoocsBackend(
const std::string& serverAddress,
const std::string& cacheFile,
const std::string& updateCache,
62 const std::string& dataConsistencyRealmName);
70 void close()
override;
77 std::
string address, std::map<std::
string, std::
string> parameters);
79 template<typename UserType>
81 const RegisterPath& registerPathName,
size_t numberOfWords,
size_t wordOffsetInRegister, AccessModeFlags flags);
97 template<
typename UserType>
109 std::lock_guard<std::mutex> lk(_mxRecovery);
110 return _startVersion;
114 std::string _cacheFile;
115 std::promise<void> _cancelFlag{};
116 mutable std::future<DoocsBackendRegisterCatalogue> _catalogueFuture;
118 bool _catalogueFromCache{
false};
120 bool cacheFileExists();
121 bool isCachingEnabled()
const;
124 mutable std::mutex _mxRecovery;
127 VersionNumber _startVersion{
nullptr};
130 std::string lastFailedAddress;
132 std::shared_ptr<async::DataConsistencyRealm> _dataConsistencyRealm;
Class to register the backend type with the factory.
Backend to access DOOCS control system servers.
std::atomic< bool > _asyncReadActivated
VersionNumber getStartVersion()
std::string _serverAddress
DOOCS address component for the server (FACILITY/DEVICE)
void activateAsyncRead() noexcept override
std::string readDeviceInfo() override
static boost::shared_ptr< DeviceBackend > createInstance(std::string address, std::map< std::string, std::string > parameters)
const DoocsBackendRegisterCatalogue & getBackendRegisterCatalogue() const
void informRuntimeError(const std::string &address)
Called by accessors to inform about addess causing a runtime_error.
static BackendRegisterer backendRegisterer
RegisterCatalogue getRegisterCatalogue() const override
boost::shared_ptr< NDRegisterAccessor< UserType > > getRegisterAccessor_impl(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
static bool checkZmqAvailability(const std::string &fullLocationPath, const std::string &propertyName)
Utility function to check if a property is published by ZMQ.
void setExceptionImpl() noexcept override
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER(DoocsBackend, getRegisterAccessor_impl, 4)