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;
116 std::string _cacheFile;
117 std::promise<void> _cancelFlag{};
118 mutable std::future<DoocsBackendRegisterCatalogue> _catalogueFuture;
120 bool _catalogueFromCache{
false};
122 bool cacheFileExists();
123 bool isCachingEnabled()
const;
126 mutable std::mutex _mxRecovery;
129 VersionNumber _startVersion{
nullptr};
132 std::string lastFailedAddress;
134 std::shared_ptr<async::DataConsistencyRealm> _dataConsistencyRealm;
Class to register the backend type with the factory.
Backend to access DOOCS control system servers.
static bool isCommunicationError(int doocs_error)
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)