ChimeraTK-DeviceAccess-DoocsBackend 01.11.02
Loading...
Searching...
No Matches
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, const std::string &dataConsistencyRealmName)
 
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.
 
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.
 
static bool isCommunicationError (int doocs_error)
 

Public Attributes

std::string _serverAddress
 DOOCS address component for the server (FACILITY/DEVICE)
 
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 57 of file DoocsBackend.h.

Constructor & Destructor Documentation

◆ ~DoocsBackend()

ChimeraTK::DoocsBackend::~DoocsBackend ( )
override

Definition at line 114 of file DoocsBackend.cc.

◆ DoocsBackend()

ChimeraTK::DoocsBackend::DoocsBackend ( const std::string &  serverAddress,
const std::string &  cacheFile,
const std::string &  updateCache,
const std::string &  dataConsistencyRealmName 
)

Definition at line 83 of file DoocsBackend.cc.

Member Function Documentation

◆ activateAsyncRead()

void ChimeraTK::DoocsBackend::activateAsyncRead ( )
overridenoexcept

Definition at line 253 of file DoocsBackend.cc.

◆ 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 224 of file DoocsBackend.cc.

◆ createInstance()

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

Definition at line 144 of file DoocsBackend.cc.

◆ 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 215 of file DoocsBackend.cc.

◆ 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 269 of file DoocsBackend.cc.

◆ getRegisterCatalogue()

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

Definition at line 209 of file DoocsBackend.cc.

◆ getStartVersion()

VersionNumber ChimeraTK::DoocsBackend::getStartVersion ( )
inline

Definition at line 108 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 237 of file DoocsBackend.cc.

◆ isCommunicationError()

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

Definition at line 423 of file DoocsBackend.cc.

◆ open()

void ChimeraTK::DoocsBackend::open ( )
override

Definition at line 177 of file DoocsBackend.cc.

◆ readDeviceInfo()

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

Definition at line 72 of file DoocsBackend.h.

◆ setExceptionImpl()

void ChimeraTK::DoocsBackend::setExceptionImpl ( )
overridenoexcept

Definition at line 246 of file DoocsBackend.cc.

Friends And Related Symbol Documentation

◆ DoocsBackendRegisterAccessor

template<typename UserType >
friend class DoocsBackendRegisterAccessor
friend

Definition at line 98 of file DoocsBackend.h.

Member Data Documentation

◆ _asyncReadActivated

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

Definition at line 106 of file DoocsBackend.h.

◆ _serverAddress

std::string ChimeraTK::DoocsBackend::_serverAddress

DOOCS address component for the server (FACILITY/DEVICE)

Definition at line 85 of file DoocsBackend.h.

◆ backendRegisterer

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

Definition at line 92 of file DoocsBackend.h.


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