Skip to content
Snippets Groups Projects
ConsumingFanOut.h 1.47 KiB
Newer Older
/*
 * ConsumingFanOut.h
 *
 *  Created on: Jun 15, 2016
 *      Author: Martin Hierholzer
 */

#ifndef CHIMERATK_CONSUMING_FAN_OUT_H
#define CHIMERATK_CONSUMING_FAN_OUT_H

#include <ChimeraTK/NDRegisterAccessorDecorator.h>
  /** FanOut implementation which acts as a read-only (i.e. consuming) NDRegisterAccessor. The values read through
   *  this accessor will be obtained from the given feeding implementation and distributed to any number of slaves. */
  class ConsumingFanOut : public FanOut<UserType>, public ChimeraTK::NDRegisterAccessorDecorator<UserType> {
      ConsumingFanOut(boost::shared_ptr<ChimeraTK::NDRegisterAccessor<UserType>> feedingImpl)
          ChimeraTK::NDRegisterAccessorDecorator<UserType>(feedingImpl)
        ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead();
        for(auto &slave : FanOut<UserType>::slaves) {     // send out copies to slaves
          // do not send copy if no data is expected (e.g. trigger)
          if(slave->getNumberOfSamples() != 0) {
      using ChimeraTK::NDRegisterAccessor<UserType>::buffer_2D;

  };

} /* namespace ChimeraTK */

#endif /* CHIMERATK_CONSUMING_FAN_OUT_H */