18 const std::exception_ptr& firstDetectedRuntimeError) noexcept {
19 for(
const auto& elem : elements) {
21 for(
const auto& lowLevelElem : elem->getHardwareAccessingElements()) {
25 if(lowLevelElem->_activeException) {
27 elem->_activeException = lowLevelElem->_activeException;
34 elem->postReadAndHandleExceptions(
TransferType::read, firstDetectedRuntimeError ==
nullptr);
52 if(backend && !backend->isOpen()) {
60 std::exception_ptr firstDetectedRuntimeError{
nullptr};
64 if((elem->_activeException !=
nullptr) && (firstDetectedRuntimeError ==
nullptr)) {
65 firstDetectedRuntimeError = elem->_activeException;
71 if((elem->_activeException !=
nullptr) && (firstDetectedRuntimeError ==
nullptr)) {
72 firstDetectedRuntimeError = elem->_activeException;
76 if(firstDetectedRuntimeError ==
nullptr) {
79 const auto& elem = it.first;
80 elem->handleTransferException([&] { elem->readTransfer(); });
81 if((elem->_activeException !=
nullptr) && (firstDetectedRuntimeError ==
nullptr)) {
82 firstDetectedRuntimeError = elem->_activeException;
114 assert(firstDetectedRuntimeError !=
nullptr);
117 std::rethrow_exception(firstDetectedRuntimeError);
126 if(backend && !backend->isOpen()) {
138 std::exception_ptr firstDetectedRuntimeError{
nullptr};
141 if((elem->_activeException !=
nullptr) && (firstDetectedRuntimeError ==
nullptr)) {
142 firstDetectedRuntimeError = elem->_activeException;
146 if(firstDetectedRuntimeError ==
nullptr) {
148 const auto& elem = it.first;
149 elem->handleTransferException([&] { elem->writeTransfer(versionNumber); });
150 if((elem->_activeException !=
nullptr) && (firstDetectedRuntimeError ==
nullptr)) {
151 firstDetectedRuntimeError = elem->_activeException;
159 for(
const auto& lowLevelElem : elem->getHardwareAccessingElements()) {
163 if(lowLevelElem->_activeException) {
165 elem->_activeException = lowLevelElem->_activeException;
178 assert(firstDetectedRuntimeError !=
nullptr);
180 std::rethrow_exception(firstDetectedRuntimeError);
220 "A TransferGroup can only be used with transfer elements that don't have aAccessMode::wait_for_new_data.");
232 for(
const auto& hlElem1 : highLevelElementsWithNewAccessor) {
233 auto list = hlElem1->getInternalElements();
234 list.push_front(hlElem1);
236 for(
const auto& replacement : list) {
241 for(
const auto& hlElem : highLevelElementsWithNewAccessor) {
242 hlElem->replaceTransferElement(replacement);
258 for(
const auto& hwElem : hlElem->getHardwareAccessingElements()) {
266 if(boost::dynamic_pointer_cast<ChimeraTK::CopyRegisterDecoratorTrait>(hlElem) !=
nullptr) {
269 for(
const auto& hwElem : hlElem->getInternalElements()) {
270 if(boost::dynamic_pointer_cast<ChimeraTK::CopyRegisterDecoratorTrait>(hwElem) !=
nullptr) {
285 struct TransferGroupTransferElementAbstractor : TransferElementAbstractor {
286 explicit TransferGroupTransferElementAbstractor(boost::shared_ptr<TransferElement> impl)
290 _impl->replaceTransferElement(std::move(newElement));
299 auto x = detail::TransferGroupTransferElementAbstractor(accessor);
300 addAccessorImpl(x,
true);
306 addAccessorImpl(accessor,
false);
324 std::cout <<
"=== Accessors added to this group: " << std::endl;
326 std::cout <<
" - " << elem->getName() << std::endl;
328 std::cout <<
"=== Low-level transfer elements in this group: " << std::endl;
330 std::cout <<
" - " << elem.first->getName() << std::endl;
332 std::cout <<
"===" << std::endl;