Digitalisierte Elektroverteilung zur permanenten Verbraucherüberwachung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PublisherInterface.h 891B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <memory>
  3. #include "PublisherData.h"
  4. #include "ModbusDataInterface.h"
  5. #include "modbus_interface_lib.h"
  6. #include "ts_queue.h"
  7. #include "SystemConfig.h"
  8. class PublisherInterface
  9. {
  10. private:
  11. static u_int id_static;
  12. protected:
  13. const u_int id;
  14. const PublisherType type;
  15. std::unique_ptr<ModbusInterface> connection;
  16. std::unique_ptr<ModbusDataInterface> modbusData;
  17. public:
  18. PublisherInterface(const PublisherType type);
  19. virtual ~PublisherInterface(){}
  20. ts_queue<ParameterSpecification>& enqueueReadingRegisters(ts_queue<ParameterSpecification>& queue, Category cat);
  21. virtual std::string getName()const = 0;
  22. bool open(){ return connection->openConnection(); }
  23. bool isOpen() const { return connection->getIsOpen(); }
  24. u_int getID()const { return id; }
  25. //operator overloading
  26. inline bool operator==(const PublisherInterface& p2)const;
  27. };