Skip to content
Base_DAQ_Observer.h 1.73 KiB
Newer Older
Valerio Pastore's avatar
Valerio Pastore committed
#pragma once

Valerio Pastore's avatar
Valerio Pastore committed
#include <Base_DAQ.h>
Valerio Pastore's avatar
Valerio Pastore committed
/**
 * @brief The BaseDAQ_Observer class is an abstract base class for DAQ system observers.
 * 
 * This class defines the interface for observing the statistics and status of a BaseDAQ object.
 * Subclasses of BaseDAQ_Observer must implement the pure virtual functions defined in this class.
 * 
 */
Valerio Pastore's avatar
Valerio Pastore committed
namespace inaf::oasbo::DAQ_observers{

class BaseDAQ_Observer{
protected:
Valerio Pastore's avatar
Valerio Pastore committed
	inaf::oasbo::DAQ::BaseDAQ *dataAcquisition;
Valerio Pastore's avatar
Valerio Pastore committed

public:
Valerio Pastore's avatar
Valerio Pastore committed
  /**
   * @brief Constructs a BaseDAQ_Observer object with the specified BaseDAQ object.
   * 
   * @param dataAcquisition The BaseDAQ object to observe.
   */
Valerio Pastore's avatar
Valerio Pastore committed
  BaseDAQ_Observer(inaf::oasbo::DAQ::BaseDAQ &dataAcquisition) {
    this->dataAcquisition = &dataAcquisition;
Valerio Pastore's avatar
Valerio Pastore committed
  }

Valerio Pastore's avatar
Valerio Pastore committed
  /**
   * @brief Destroys the BaseDAQ_Observer object and removes itself from the observed BaseDAQ object.
   */
Valerio Pastore's avatar
Valerio Pastore committed
 virtual ~BaseDAQ_Observer() {
    this->dataAcquisition->removeObserver(this);
  }

Valerio Pastore's avatar
Valerio Pastore committed
  /**
   * @brief Updates the packet statistics of the observed BaseDAQ object.
   */
Valerio Pastore's avatar
Valerio Pastore committed
  virtual void updatePacketStats() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

  /**
   * @brief Updates the archiver statistics of the observed BaseDAQ object.
   */
Valerio Pastore's avatar
Valerio Pastore committed
  virtual void updateArchiverStats() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

  /**
   * @brief Updates the provider statistics of the observed BaseDAQ object.
   */
Valerio Pastore's avatar
Valerio Pastore committed
  virtual void updateProviderStats() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

  /**
   * @brief Updates the receiver statistics of the observed BaseDAQ object.
   */
Valerio Pastore's avatar
Valerio Pastore committed
  virtual void updateReceiverStats() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

  /**
   * @brief Updates all statistics of the observed BaseDAQ object.
   */
astri's avatar
astri committed
  virtual void updateAll() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

  /**
   * @brief Starts the observation on the BaseDAQ object.
   */
astri's avatar
astri committed
  virtual void start() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

  /**
   * @brief Stops the observation on the BaseDAQ object.
   */
astri's avatar
astri committed
  virtual void stop() = 0;
Valerio Pastore's avatar
Valerio Pastore committed

};
}