ChimeraTK-DeviceAccess  03.18.00
VoidRegisterAccessor.cc
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #include "VoidRegisterAccessor.h"
5 
6 namespace ChimeraTK {
7 
8  /********************************************************************************************************************/
9 
12  if(!impl->getAccessModeFlags().has(AccessMode::wait_for_new_data) && !impl->isWriteable()) {
14  "A VoidRegisterAccessor without wait_for_new_data does not make sense for non-writeable register " +
15  impl->getName());
16  }
17  }
18 
19  /********************************************************************************************************************/
20 
22  // synchronous void accessors are never readable, hence they are never read-only
23  if(!_impl->getAccessModeFlags().has(AccessMode::wait_for_new_data)) {
24  return false;
25  }
26  return _impl->isReadOnly();
27  }
28 
29  /********************************************************************************************************************/
30 
32  // synchronous void accessors are never readable
33  if(!_impl->getAccessModeFlags().has(AccessMode::wait_for_new_data)) {
34  return false;
35  }
36  return _impl->isReadable();
37  }
38 
39  /********************************************************************************************************************/
40 
41 } // namespace ChimeraTK
VoidRegisterAccessor.h
ChimeraTK::VoidRegisterAccessor::VoidRegisterAccessor
VoidRegisterAccessor()=default
Placeholder constructer, to allow late initialisation of the accessor, e.g.
ChimeraTK::VoidRegisterAccessor::isReadable
bool isReadable() const
Definition: VoidRegisterAccessor.cc:31
ChimeraTK::AccessMode::wait_for_new_data
@ wait_for_new_data
Make any read blocking until new data has arrived since the last read.
ChimeraTK::NDRegisterAccessorAbstractor
Base class for the register accessor abstractors (ScalarRegisterAccessor, OneDRegisterAccessor and Tw...
Definition: NDRegisterAccessorAbstractor.h:19
ChimeraTK::VoidRegisterAccessor::isReadOnly
bool isReadOnly() const
Definition: VoidRegisterAccessor.cc:21
ChimeraTK::TransferElementAbstractor::_impl
boost::shared_ptr< TransferElement > _impl
Untyped pointer to implementation.
Definition: TransferElementAbstractor.h:225
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::NDRegisterAccessor
N-dimensional register accessor.
Definition: ForwardDeclarations.h:17
ChimeraTK::logic_error
Exception thrown when a logic error has occured.
Definition: Exception.h:51