ChimeraTK-DeviceAccess-DoocsBackend  01.09.02
ChimeraTK::DoocsBackend Class Reference

Backend to access DOOCS control system servers. More...

#include <DoocsBackend.h>

+ Inheritance diagram for ChimeraTK::DoocsBackend:
+ Collaboration diagram for ChimeraTK::DoocsBackend:

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 DoocsBackendRegisterCataloguegetBackendRegisterCatalogue () 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 &registerPathName, 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~DoocsBackend()

ChimeraTK::DoocsBackend::~DoocsBackend ( )
override

Definition at line 110 of file DoocsBackend.cc.

◆ DoocsBackend()

ChimeraTK::DoocsBackend::DoocsBackend ( const std::string &  serverAddress,
const std::string &  cacheFile = {},
const std::string &  updateCache = {} 
)

Definition at line 82 of file DoocsBackend.cc.

Member Function Documentation

◆ activateAsyncRead()

void ChimeraTK::DoocsBackend::activateAsyncRead ( )
overridenoexcept

Definition at line 235 of file DoocsBackend.cc.

+ Here is the call graph for this function:

◆ checkZmqAvailability()

static bool ChimeraTK::DoocsBackend::checkZmqAvailability ( const std::string &  fullLocationPath,
const std::string &  propertyName 
)
static

Utility function to check if a property is published by ZMQ.

◆ close()

void ChimeraTK::DoocsBackend::close ( )
override

Definition at line 206 of file DoocsBackend.cc.

+ Here is the call graph for this function:

◆ createInstance()

boost::shared_ptr< DeviceBackend > ChimeraTK::DoocsBackend::createInstance ( std::string  address,
std::map< std::string, std::string >  parameters 
)
static

Definition at line 140 of file DoocsBackend.cc.

+ Here is the caller graph for this function:

◆ DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER()

ChimeraTK::DoocsBackend::DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER ( DoocsBackend  ,
getRegisterAccessor_impl  ,
 
)

◆ getBackendRegisterCatalogue()

const DoocsBackendRegisterCatalogue & ChimeraTK::DoocsBackend::getBackendRegisterCatalogue ( ) const

Definition at line 197 of file DoocsBackend.cc.

+ Here is the caller graph for this function:

◆ getRegisterAccessor_impl()

template<typename UserType >
boost::shared_ptr< NDRegisterAccessor< UserType > > ChimeraTK::DoocsBackend::getRegisterAccessor_impl ( const RegisterPath &  registerPathName,
size_t  numberOfWords,
size_t  wordOffsetInRegister,
AccessModeFlags  flags 
)

Definition at line 246 of file DoocsBackend.cc.

+ Here is the call graph for this function:

◆ getRegisterCatalogue()

RegisterCatalogue ChimeraTK::DoocsBackend::getRegisterCatalogue ( ) const
override

Definition at line 191 of file DoocsBackend.cc.

+ Here is the call graph for this function:

◆ getStartVersion()

VersionNumber ChimeraTK::DoocsBackend::getStartVersion ( )
inline

Definition at line 107 of file DoocsBackend.h.

◆ informRuntimeError()

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.

◆ isCommunicationError()

bool ChimeraTK::DoocsBackend::isCommunicationError ( int  doocs_error)
static

Definition at line 400 of file DoocsBackend.cc.

+ Here is the caller graph for this function:

◆ open()

void ChimeraTK::DoocsBackend::open ( )
override

Definition at line 167 of file DoocsBackend.cc.

+ Here is the call graph for this function:

◆ readDeviceInfo()

std::string ChimeraTK::DoocsBackend::readDeviceInfo ( )
inlineoverride

Definition at line 71 of file DoocsBackend.h.

◆ setExceptionImpl()

void ChimeraTK::DoocsBackend::setExceptionImpl ( )
overridenoexcept

Definition at line 228 of file DoocsBackend.cc.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ DoocsBackendRegisterAccessor

template<typename UserType >
friend class DoocsBackendRegisterAccessor
friend

Definition at line 97 of file DoocsBackend.h.

Member Data Documentation

◆ _asyncReadActivated

std::atomic<bool> ChimeraTK::DoocsBackend::_asyncReadActivated {false}

Definition at line 105 of file DoocsBackend.h.

◆ _serverAddress

std::string ChimeraTK::DoocsBackend::_serverAddress

DOOCS address component for the server (FACILITY/DEVICE)

Definition at line 84 of file DoocsBackend.h.

◆ backendRegisterer

DoocsBackend::BackendRegisterer ChimeraTK::DoocsBackend::backendRegisterer
static

Definition at line 91 of file DoocsBackend.h.


The documentation for this class was generated from the following files: