ChimeraTK-DeviceAccess-DoocsBackend
01.09.02
|
Backend to access DOOCS control system servers. More...
#include <DoocsBackend.h>
Classes | |
class | BackendRegisterer |
Class to register the backend type with the factory. More... | |
Public Member Functions | |
~DoocsBackend () override | |
DoocsBackend (const std::string &serverAddress, const std::string &cacheFile={}, const std::string &updateCache={}) | |
RegisterCatalogue | getRegisterCatalogue () const override |
const DoocsBackendRegisterCatalogue & | getBackendRegisterCatalogue () const |
void | open () override |
void | close () override |
std::string | readDeviceInfo () override |
void | setExceptionImpl () noexcept override |
template<typename UserType > | |
boost::shared_ptr< NDRegisterAccessor< UserType > > | getRegisterAccessor_impl (const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags) |
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER (DoocsBackend, getRegisterAccessor_impl, 4) | |
void | informRuntimeError (const std::string &address) |
Called by accessors to inform about addess causing a runtime_error. More... | |
void | activateAsyncRead () noexcept override |
VersionNumber | getStartVersion () |
Static Public Member Functions | |
static boost::shared_ptr< DeviceBackend > | createInstance (std::string address, std::map< std::string, std::string > parameters) |
static bool | checkZmqAvailability (const std::string &fullLocationPath, const std::string &propertyName) |
Utility function to check if a property is published by ZMQ. More... | |
static bool | isCommunicationError (int doocs_error) |
Public Attributes | |
std::string | _serverAddress |
DOOCS address component for the server (FACILITY/DEVICE) More... | |
std::atomic< bool > | _asyncReadActivated {false} |
Static Public Attributes | |
static BackendRegisterer | backendRegisterer |
Friends | |
template<typename UserType > | |
class | DoocsBackendRegisterAccessor |
Backend to access DOOCS control system servers.
The CDD should look like this:
(doocs:FACILITY/DEVICE)
or:
(doocs:FACILITY/DEVICE/LOCATION)
The given path components are prefixed to the register names, hence if the LOCATION is not specified in the CDD, the register names will be of the form LOCATION/PROPERTY, while otherwise the register names will be just the property names.
If the parameter "cacheFile" in the CDD is specified, e.g.:
(doocs:FACILITY/DEVICE/LOCATION?cacheFile=myDooceDevice.cache)
the register catalogue will be cached in the given file and reused next time. This allows to speed up the filling of the catalogue (which may take a very long time for large number of properties).
Please note that the cache file is only updated when the "updateCache" parameter is set to 1, e.g.:
(doocs:FACILITY/DEVICE/LOCATION?cacheFile=myDooceDevice.cache&updateCache=1)
Otherwise no catalogue updating will be initiated if the cache file is already present.
If AccessMode::wait_for_new_data is specified when obtaining accessors, ZeroMQ is used to subscribe to the variable and blocking read() will wait until new data has arrived via the subscribtion. If the flag is not specified, data will be retrieved through standard RPC calls. Note that in either case a first read transfer is performed upon creation of the accessor to make sure the property exists and the server is reachable, and to obtain the initial value.
Definition at line 56 of file DoocsBackend.h.
|
override |
Definition at line 110 of file DoocsBackend.cc.
ChimeraTK::DoocsBackend::DoocsBackend | ( | const std::string & | serverAddress, |
const std::string & | cacheFile = {} , |
||
const std::string & | updateCache = {} |
||
) |
Definition at line 82 of file DoocsBackend.cc.
|
overridenoexcept |
|
static |
Utility function to check if a property is published by ZMQ.
|
override |
|
static |
ChimeraTK::DoocsBackend::DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER | ( | DoocsBackend | , |
getRegisterAccessor_impl | , | ||
4 | |||
) |
const DoocsBackendRegisterCatalogue & ChimeraTK::DoocsBackend::getBackendRegisterCatalogue | ( | ) | const |
boost::shared_ptr< NDRegisterAccessor< UserType > > ChimeraTK::DoocsBackend::getRegisterAccessor_impl | ( | const RegisterPath & | registerPathName, |
size_t | numberOfWords, | ||
size_t | wordOffsetInRegister, | ||
AccessModeFlags | flags | ||
) |
|
override |
|
inline |
Definition at line 107 of file DoocsBackend.h.
void ChimeraTK::DoocsBackend::informRuntimeError | ( | const std::string & | address | ) |
Called by accessors to inform about addess causing a runtime_error.
Does not switch backend into exception state, this is done separately by calling setException().
Definition at line 219 of file DoocsBackend.cc.
|
static |
|
override |
|
inlineoverride |
Definition at line 71 of file DoocsBackend.h.
|
overridenoexcept |
|
friend |
Definition at line 97 of file DoocsBackend.h.
std::atomic<bool> ChimeraTK::DoocsBackend::_asyncReadActivated {false} |
Definition at line 105 of file DoocsBackend.h.
std::string ChimeraTK::DoocsBackend::_serverAddress |
DOOCS address component for the server (FACILITY/DEVICE)
Definition at line 84 of file DoocsBackend.h.
|
static |
Definition at line 91 of file DoocsBackend.h.