1234567891011121314151617181920212223242526272829303132333435 |
- #pragma once
- #include <memory>
- #include "PublisherData.h"
- #include "ModbusDataInterface.h"
- #include "modbus_interface_lib.h"
- #include "ts_queue.h"
- #include "SystemConfig.h"
-
-
- class PublisherInterface
- {
- private:
- static u_int id_static;
-
- protected:
- const u_int id;
- const PublisherType type;
- std::unique_ptr<ModbusInterface> connection;
- std::unique_ptr<ModbusDataInterface> modbusData;
-
- public:
- PublisherInterface(const PublisherType type);
- virtual ~PublisherInterface(){}
-
- ts_queue<ParameterSpecification>& enqueueReadingRegisters(ts_queue<ParameterSpecification>& queue, Category cat);
-
- virtual std::string getName()const = 0;
-
- bool open(){ return connection->openConnection(); }
- bool isOpen() const { return connection->getIsOpen(); }
-
- u_int getID()const { return id; }
- //operator overloading
- inline bool operator==(const PublisherInterface& p2)const;
- };
|