#ifndef SENSORHANDLEROFAGENT_HEADERFILE
#define SENSORHANDLEROFAGENT_HEADERFILE

#include "SensorSlotOfAgent.h"
#include "Unit.h"
#include <vector>

using namespace std;

class SensorHandlerOfAgent : public Unit {

private:
  // TODO: set- and get function for maxNumOf_mountedSensors;
  vector<SensorSlotOfAgent *> vMountedSensors;
  unsigned int maxNumOf_mountedSensors;

  void init_sensorHandler();

public:
  SensorHandlerOfAgent();

  bool mount_sensorIntoSensorSlot(Channel *inputPort);
  SensorSlotOfAgent *get_sensorSlotAddress(Channel *inputPort);
  unsigned int get_sensorSlotNumber(Channel *inputPort);
  SensorSlotOfAgent *get_sensorSlotAddress(HistoryModule *history);
  SensorSlotOfAgent *get_sensorSlotAddress(ConfidenceModule *confidenceModule);
  bool demount_sensor(Channel *inputPort);

  bool read_sensorValue(SensorSlotOfAgent *sensorSlot);
  bool read_allSensorValues();

  bool attach_historyModule(Channel *inputPort, HistoryModule *historyModule);
  bool detach_historyModule(SensorSlotOfAgent *sensorSlotOfAgent);
  bool detach_historyModule(Channel *inputPort);
  bool detach_historyModule(HistoryModule *historyModule);
  HistoryModule *get_historyModuleOfSensorSlot(Channel *inputPort);

  bool attach_confidenceModule(Channel *inputPort,
                               ConfidenceModule *confidenceModule);
  bool detach_confidenceModule(SensorSlotOfAgent *sensorSlotOfAgent);
  bool detach_confidenceModule(Channel *inputPort);
  bool detach_confidenceModule(ConfidenceModule *confidenceModule);
  ConfidenceModule *get_confidenceModuleOfSensorSlot(Channel *inputPort);

  vector<SensorSlotOfAgent *> *get_vMountedSensors();
};

#endif
