/
Zero_Fly
/
parall
Обзор
Документация
Войти
/
Zero_Fly
/
parall
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/parallel-executor/device.h
26 строк
604 B
akulyanin
for mq
14 янв 2025, 10:57
14 янв 2025, 10:57
740d97d
Код
Авторство
О чём код?
#pragma once using namespace std; #include<memory> #include<string> extern const string ERROR_MSG = "Device doesn't response."; class Read{ public: virtual shared_ptr<string> read(string msg) = 0; }; class Device { protected: int lifeTime = -1; Read* reader; public: Device(int _lifeTime, Read* rd): lifeTime(_lifeTime), reader(rd){} Device(int _lifeTime): lifeTime(_lifeTime){} Device(){} ~Device(){} virtual shared_ptr<string> getDataAsString() = 0; virtual string getName() = 0; void decLife(){--lifeTime;} int getLifeTime(){return this->lifeTime;} };